-2
-4
-6
0.5
1.5
ym = f(xm)
y =-5.7977
plot(t, f(t), xm, ym,'o')
-2
-4
-6
0.5
1.5
-2
polyval(g,3.2)
ans =27.0400
c) h(x) = x5 + 3x4 - 11x3 + 27x2 + 10x 24
h = [1 3 -11 27 10 -24];
roots(h)
ans =
-5.6900
1.3733 + 1.8376i
1.3733 - 1.8376i
-0.9240
0.8674
>> polyval(h,3.2)
ans =574.1491
d) i(x) = x5 - 3x3 + 4x2 -1
i = [1 0 -3 4 0 -1];
roots(i)
ans =
-2.1772
0.9784 + 0.7996i
0.9784 - 0.7996i
0.6578
-0.4373
>> polyval(i,3.2)
ans =277.2003
Plote todas as funes acima (0 x 10) em um nico grfico (subplot).
3) Determine o polinmio que melhor se ajusta funo para o intervalo 5<t<5. Graficar trs tentativas, alterando a ordem do polinmio.
5 ordem
12
1.5
x 10
0.5
-0.5
-1
-1.5
-2
-5
4 ordem
-4
-3
-2
-1
12
1.5
x 10
0.5
-0.5
-1
-1.5
-2
-5
-4
-3
-2
-1
-4
-3
-2
-1
2 ordem
12
x 10
0.5
-0.5
-1
-1.5
-2
-5
>> contour(Z,10)
b)
>> [X,Y]=meshgrid(-1.5:0.01:1.5,-2.5:0.01:2.5);
>> Z=(exp(-(4*X.^2+2*Y.^2)).*cos(8*X))+(exp(3*(((2*X+1)./2).^2+2*Y.^2)));
>> mesh(X,Y,Z)
>>contour (Z,10)
>> [X,Y]=meshgrid(-1.5:0.01:1.5,-2.5:0.01:2.5);
>> Z=(exp(-(4*X.^2+2*Y.^2)).*cos(8*X))+(exp(3*(((2*X+1)./2).^2+2*Y.^2)));
>> mesh(X,Y,Z)
>> hold on
>> contour (Z, 0.001)
>> contour (Z, 0.01)