Académique Documents
Professionnel Documents
Culture Documents
A=
>> b=[1 2 3]
b=
>> c=[4;5;6;]
c=
4
5
6
x1 =
-2.0000 + 3.0000i
x1 =
-2.0000 + 3.0000i
x1 =
-2.0000 - 3.0000i
>> p=[2 7 1]
p=
>> q=[1 0 3 0 ]
q=
ans =
45
Calculo de un polinomio
q=[1 0 3 0 ]
q=
ans =
45
>> p=[1 -3 9 13 ];
>> p=[1 -3 9 13 ];
>> roots(p)
ans =
2.0000 + 3.0000i
2.0000 - 3.0000i
-1.0000
ans =
-3
9 -23
36
Multiplicacin de polinomios
>> p1=[1 - 2 1];p2=[1 1];
conv(p1,p2)
ans =
-1
ans =
-1
-1
>> [c,r]=deconv(p1,p2)
c=
r=
-3
t=
0
4.0000
0.5000
1.0000
1.5000
ans =
10
20
30
>> v1 + v2
ans =
>> v1.*v2
ans =
10
18
2.0000
2.5000
3.0000
3.5000
Grafica
>> y=10*exp(-t).*sin(5*t);
plot(t,y)
grid
xlabel('tiempo(s)')
ylabel('y(t)')
title('senoide amortiguamiento')
>> plot(t,y,'m')
>> grid on
>> plot(y,'tiempo')
fplot('10*exp(-t).*sin(5*t)',[0,10])
>> grid on
>> xlabel('tiempo')
>> ylabel('y(t)')
>> title('senoide amortiguamiento')
>>
>> t=[0:pi/180:4*pi];
>> y1=sin(t);
>> y2=cos(t)
Grafica de cuatro
>> y2=cos(t);
>> plot(t,y1,'r o',t,y2,'g -')
>> >> t=[0:pi/180:4*pi];
>> y1=sin(t);
>> y2=cos(t)
t=0:0.1:10;
>> subplot(2,2,1)
>> y1=exp(-t);
>> plot(t,y1)
>> subplot(2,2,2)
>> y2=exp(-t);
>> plot(t,y2)
>> subplot(2,2,3)
>> y3=exp(-t).*cos(t);
>> plot(t,y3)
>> subplot(2,2,4)
>> y4=exp(t).*cos(t);
>> plot(t,y4)