P14_6 - c for i = 1:21 f F(i,1) = coefs(1,1) +...

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

View Full Document Right Arrow Icon
%Problem 14.6 % function P14_6 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 A = [ones(21,1) T' 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;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c for i = 1:21 f F(i,1) = coefs(1,1) + coefs(2,1).*T(1,i) + coefs(3,1).*C(1,i); F end e X = (4:1:16)'; X Y = X; Y hold on h grid on g plot(X, Y) p scatter(b, F) s fprintf(' o = %11.8f + f F_12_15 = coefs(1,1) + coefs(2,1)*12 + coefs(3,1)*15 F error = abs((9.09 - F_12_15)/9.09)*100 e...
View Full Document

Ask a homework question - tutors are online