Question
How do i get plot from below matlab code.%Student Name: Philip Newton %Student ID: S367073 %---------------------------- % A. Temp(T) is in 'C', and Growth Rate(Gr)
How do i get plot from below matlab code.%Student Name: Philip Newton %Student ID: S367073 %---------------------------- % A. Temp(T) is in 'C', and Growth Rate(Gr) is in 'd^-1'
T=[2;5;8;11;14;20]; Gr=[0.20;0.29;0.44;0.50;0.66;0.56]; A=zeros(length(T),length(T)+1); A(:,1)=1; A(:,2)=T; A(:,3)=T.^2; A(:,4)=T.^3; A(:,5)=T.^4; A(:,6)=T.^5; A(:,7)=Gr; B=rref(A); coff=B(:,length(T)+1);
% B. T_1 are the given data points for generating the interpolation function and Gr_1 is output from interpolated polynomial
T_1=1:1:20; Gr_1=coff(1)+coff(2)*T_1+coff(3)*T_1.^2+coff(4)*T_1.^3+coff(5)*T_1.^4+coff(6)*T_1.^5; figure;plot(T,Gr,'*r',T_1,Gr_1,'k')
% Final polynomial becomes 0.6292-0.4165*T+0.1311*T^2-0.0163*T^3+9.0192e-4*T^4-1.8176e-5*T^5
% C. The microalgae exhibit a growth rate of 0.9379 per day (d^-1) at a temperature of 17.5C, as determined by the previous mentioned polynomial expression.
% D. The provided data fits well into the interpolated function, but exhibits distortion within the temperature range of 14C to 20C. This distortion is attributed to a peak introduced by the fifth-order polynomial, which may or may not be accurately represented in the given dataset. Consequently, this particular temperature range could introduce errors during estimation when interpolating additional points.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started