Matlab code:
x1=[0 2 4 6 8 10 12 14]
y1=[0 3 5 8 8.5 7.1 4.9 1.7]
x2=[14 12 10 8 6 4 2 0]
y2=[1.7 -2.6 -3.8 -6.1 -5.9 -5.2 -4.1 0]
P1=polyfit(x1,y1,4);
fprintf('1st data set equation is = (%d)x^4+(%d)x^3+(%d)x^2+(%d)x+(%d)\n',P1(1),P1(2),P1(3),P1(4),P1(5))
P2=polyfit(x2,y2,4);
fprintf('2nd data set equation is =(%d)x^4+(%d)x^3+(%d)x^2+(%d)x+(%d)',P2(1),P2(2),P2(3),P2(4),P2(5))
fun1=@(x1) (P1(1)*x1^4+P1(2)*x1^3+P1(3)*x1^2+P1(4)*x1+P1(5))
Function_1_Zero_at=fzero(fun1,0)
fun2=@(x2) (P2(1)*x2^4+P2(2)*x2^3+P2(3)*x2^2+P2(4)*x2+P2(5))
Function_2_Zero_at=fzero(fun2,0)
plot(x1,y1,x2,y2)
xlabel('x')
ylabel('y')
OUTPUT------------
x1 = 0 2 4 6 8 10 12 14 y1 = 0.00000 3.00000 5.00000 8.00000 8.50000 7.10000 4.90000 1.70000 x2 = 14 12 10 8 6 4 2 0 y2 = 1.70000 -2.60000 -3.80000 -6.10000 -5.90000 -5.20000 -4.10000 0.00000 1st data set equation is = (0.00126657)x^4+(-0.0398201)x^3+(0.251752)x^2+(0.920319)x+(0.0840909) 2nd data set equation is =(0.00106534)x^4+(-0.0313447)x^3+(0.427746)x^2+(-2.64708)x+(-0.0515152)fun1 = @(x1) (P1 (1) * x1 ^ 4 + P1 (2) * x1 ^ 3 + P1 (3) * x1 ^ 2 + P1 (4) * x1 + P1 (5)) Function_1_Zero_at = -0.093815 fun2 = @(x2) (P2 (1) * x2 ^ 4 + P2 (2) * x2 ^ 3 + P2 (3) * x2 ^ 2 + P2 (4) * x2 + P2 (5)) Function_2_Zero_at = -0.019400
Matlab code: Task 5 As an engineer you are asked to calculate the approximate surface area of a lake in your local community. In order to do that, you decide to use a GPS to measure the x and y coord...
help wanted?? thank you explain correctly Problem 1 Use the trapezoidal rule technique to approximate the following integrals: a) 「(x2+1)dr(Note: use 0.5 increments forx) b) sina d INote: use a MATLAB function to subdivide the interval into eight equal parts) c e dx (Note: use 0.25 increments for x Problem 2 Use the Simpson's rule to evaluate the following integrals aDdr Problem 3: Given the polynomial: x3-6x2 + 30-0, Use MATLAB to find all roots of this polynomial. Use MATLAB's...