P14_7 - coefs(4,1).*T3(1,i) + coefs(5,1).*C(1,i); end e X =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function P14_7 f T = [0 5 10 15 20 25 30 0 5 10 15 20 25 30 0 5 10 15 20 25 30]; T C = [0 0 0 0 0 0 0 10 10 10 10 10 10 10 20 20 20 20 20 20 20]; C T2 = T.^2; T T3 = T.^3; T A = [ones(21,1) T' T2' T3' C']; A b = [14.6 12.8 11.3 10.1 9.09 8.26 7.56 12.9 11.3 10.1 9.03 8.17 7.46 6.85 11.4 10.3 8.96 8.08 7.35 6.73 6.20]'; 1 coefs = A\b; c for i = 1:21 F(i,1) = coefs(1,1) + coefs(2,1).*T(1,i) + coefs(3,1).*T2(1,i) +
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: coefs(4,1).*T3(1,i) + coefs(5,1).*C(1,i); end e X = (6:1:16)'; X Y = X; Y hold on h grid on g scatter(b, F) s plot(X, Y) p fprintf('o = %9.6f + %8.6fT + %10.8fT^2 + %11.9fT^3 + %10.8fc\n', coef f F_12_15 = coefs(1,1) + coefs(2,1)*12 + coefs(3,1)*12^2 + coefs(4,1)*12^3 + coefs(5,1)*15 c error = abs((9.09 - F_12_15)/9.09)*100 e...
View Full Document

Ask a homework question - tutors are online