{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

oxygen - fprintf\nDerived Polynomial...

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

View Full Document Right Arrow Icon
function oxygen(T,o1) %Problem 14.5 % %T=temperature in degrees Celsius %o1 is a measurement of dissolved oxygen (mg/L) for Temperatures. %p=polyfit(x,y,n) % x=independent variable % y=dependent variable % n=the order of the polynomial coef=polyfit(T,o1,5); TT=linspace(min(T),max(T),50); y=coef(6)+coef(5).*TT+coef(4).*TT.^2+coef(3).*TT.^3+coef(2).*TT.^4+coef(1).*TT.^5;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fprintf('\nDerived Polynomial, y=%6.4f+%5.4fx+%5.4fx^2+%5.4fx^3+%5.4fx^4+%5.4fx^5\ n\n',coef(6),coef(5),coef(4),coef(3),coef(2),coef(1)); plot(T,o1,'o',TT,y); title('Polynomial regression'); xlabel('T(C)'); ylabel('Oxygen(mg/L)');...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online