Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
format short
disp('Representacin de un polinomio')
disp('5x^3+x^2+3X+4')
p=[5 1 3 4]
disp('Hallamos sus raices:')
r=roots(p)
Representacion de un polinomio
5x^3+x^2+3X+4
p =
5 1 3 4
r =
0.2850 + 0.9786i
0.2850 - 0.9786i
-0.7700 + 0.0000i
2. Evaluacion de un polinomio
5x^3+x^2+3X+4
y(2,2)=?
p =
5 1 3 4
yi =
68.6800
X=[1.1;2.5;3.6;5.2]
Y=[3.665;4.367;4.341;2.017]
a=polyfit(x, y, length(x)-1)
x =
a =
0.9160
0.8109
0.6931
0.5596
0.4055
5. Graficar los puntos:(3, 2), (5, 0), (2, 3), (1, 4),(4, 1)
x=[3 5 2 1 4];
y=[2 0 3 4 1];
plot(x,y)
6. Grafica de la funcin y=sin(x)
x=[-10: 0.2: 10]; y=sin(x);
close
plot(x,y)
grid
xlabel('x'); ylabel('y')
8. Graficar: f(x)=cso(x)cosh(x)+1
elf; clear % o clg; clear
x=-5: 0.1: 5;
y=cos(x).*cosh(x)+1;
plot(x,y);
grid
xlabel('x'); ylabel('y=cos(x)*cosh(x)+1'
f =
Columns 1 through 12
Columns 13 through 24
Columns 25 through 36
Columns 37 through 48
1.2990 1.2877 1.2672 1.2377 1.1997 1.1537
1.1003 1.0402 0.9740 0.9027 0.8270 0.7479
Columns 49 through 60
Columns 61 through 72
Columns 73 through 84
Columns 85 through 96
close
plot(x,f)
grid
x=-5:0.1:10;
f=inline('0.5*exp(x/3)-sin(x)')
fzero(f,0.5)
f =
Inline function:
f(x) = 0.5*exp(x/3)-sin(x)
ans =
0.6772