Matlab code....***to answer, MATLAB software is needed.****Q1 Given the followin
ID: 3258207 • Letter: M
Question
Matlab code....***to answer, MATLAB software is needed.****Q1
Given the following data:
x=[0 5 10 15 20 25 30]
y=[ 0 358.27 684.56 827.73 843.51 786.98 696.01]
z=[0 71.653 68.456 55.182 42.176 31.479 23.2]
Using MATLAB, respond the following:
(i) Use regression analysis to fit a parabola to y as a function of x and plot the parabola (line only) and the data (symbols only).(DO NOT USE polyfit)
ii) Use regression analysis to fit a 4th-order polynomial to z as a function of x and plot the results.(DO NOT USE polyfit.)
(iii) Calculate the correlation coefficients of the analyses in (i) and (ii).
Please see bellow analytical part. I need a MATLAB script please.
data X 5 10 15 20 30 G15 9 o 35813 65456 1 653 68 55.182 be hold a by t 358, a 684.56 e 100a boat 106- 68 S6 s 100 at 90 b 433.08 O 6 4.56 LO bat rob 10b 248.52 20 sub b in e110lExplanation / Answer
y=[ 0 ; 358.27 ; 684.56 ; 827.73 ; 843.51 ;
x2 = [1 0 0;1 5 25 ; 1 10 100 ;1 15 225; 1 20 400; 1 25 625 ; 1 30 900];
>> b2 = inv (((x2')*x2))*x2'*y
b2 =
4.1633
85.2469
-2.1024
hence y^ = 4.1633 +85.2469 x -2.1024x^2
b)
x4 =[1 0 0 0 0;1 5 25 125 625 ;1 10 100 1000 10000; 1 15 225 3375 15^4; 1 20 400 20^3 20^4 ; 1 25 625 25^3 25^4 ; 1 30 900 30^3 30^4];
>> x4
x4 =
1 0 0 0 0
1 5 25 125 625
1 10 100 1000 10000
1 15 225 3375 50625
1 20 400 8000 160000
1 25 625 15625 390625
1 30 900 27000 810000
>> b2 = inv (((x4')*x4))*x4'*y
b2 =
-2.8743
75.6117
0.6224
-0.1816
0.0034
hence y = -2.8743 +75.6117 x +0.6224*x^2 -0.1816x^3 +0.0034*x^4