You are on page 1of 7

# PRACTICA N° 2

CURSO: 3ERO “B” de ELECTRICA
FECHA: 24/04/14
PROGRAMA HECHO EN MATLAB
A=[1 2 3; 3 4 5; 6 7 8]
A=
1
3
6

2
4
7

3
5
8

>> B= [1 2 3
B= [ 1 ; 2 ;3]
B= [ 1 ; 2 ;3]
|
Error: The expression to the left of the equals sign is not a valid target for an
assignment.
>> B= [ 1 ; 2 ;3]
B=
1
2
3
>> C = [ 1 2 3]
C=
1
>>
>>
>>
>>

2

3

% ECUACION DE SEGUNDO GRADO
a=1; b=4; c=13;
% FORMULA DE LA ECUACION
x1=(-b+sqrt(b^2-4*a*c))/(2*a)

x1 =
-2.0000 + 3.0000i
>> x2=(-b-sqrt(b^2-4*a*c))/(2*a)
x2 =
-2.0000 - 3.0000i
>> % OPERACIONES CON POLINOMIOS

0000i -1.p2) .>> p=[ 2 7 1 ] p= 2 7 1 >> q = [ 1 0 3 0 ] q= 1 0 3 0 >> %EVALUAR UN POLINOMIO >> P= [ 1 5 8 1 ] P= 1 5 8 1 >> polyval(P.2) ans = 45 >> %RAICES DE UN POLINOMIO >> p=[1 -3 9 13].3. >> roots(p) ans = 2. >> conv(p1.0000i 2.0000 >> % RECONSTRUCCION DE UN POLINOMIO APARTIR DE LAS RAICES >> raices=[-1 2+3i 2-3i].0000 .p2=[ 1 1].p2) ans = 1 -1 -1 1 >> %division >> [c. >> poly(raices) ans = 1 -3 9 13 >> % MULTIPLICAR Y DIVIDIR LOS POLINOMIOS >> p1=[1 -2 1].0000 + 3.r]= deconv(p1.

k*v1 ans = 10 20 30 >> %v1+v2 >> v1+v2 ans = 5 7 9 >> %v1.*v2 >> v1.5 : 4] t= 0 4.5000 3.0000 >> >> >> >> 0.c= 1 -3 0 0 r= 4 >> %VELOCIDAD DE UN MOTOR >> t=[0: 0.5000 >> t=[0:0.5000 % OPERACIONES CON VECTORES Y MATRICES %k*v1 k=10.0000 1.^v2 .0000 3.v1=[1 2 3].0000 1.5000 3.0000 3.*v2 ans = 4 10 18 >> v1.0000 2.v2=[4 5 6].5:4] t= 0 4.5000 2.^v2 ans = 1 32 729 >> %v1.5000 2.5000 1.5000 1.0000 0.0000 2.

'r *') >> grid >> >> >> >> >> >> %UTILIZANDO fplot fplot('10*exp(-t).1:10].^v2 ans = 1 32 729 >> %REPRESENTACION GRAFICA DE FUNCIONES EN 2D Y EN 3D >> %REPRESENTAR LA SENOIDE AMORTIGUADA >> t=[0:0. >> y=10*exp(-t).'r' *) plot(t. >> y=10*exp(-t)*sin(5*t). >> plot(t.*sin(5*t). Error using * Inner matrix dimensions must agree. >> plot(t.'r') >> plot(t.10]) grid xlabel('tiempo(s)') ylabel('y(t)') title('Senoidal Amortiguada') .'r' *) | Error: Unbalanced or unexpected parenthesis or bracket.[0.y) >> grid >> xlabel('tiempo(s)') >> ylabel('y(t)') >> title('Senoide Amortiguada') >> plot(t.y.*sin(5*t)'.y.y.y.>> v1.

yl.y2. >> y2=cos(t).'g-') Undefined function or variable 'yl'.t.y2.'r o'. >> plot(t. >> y1=sin(t).'r o'.t. >> plot(t.>> %GRAFICA >> t=[0:pi/180:4*pi].'g-') .y1.

plot(t.*cos(t). plot(t.2.1:10. >> >> >> >> >> >> >> >> >> y2=t.3) y3=exp(-t).4) y4=exp(t).*exp(-t). >> plot(t.2) >> y2=t*exp(-t).2.y4) grid on .2.y1) >> subplot(2. >> subplot(2. Error using * Inner matrix dimensions must agree.1) >> yl=exp(-t). >> y1=exp(-t).>> %DISTINTAS VENTANAS >> t=0:0.y3) subplot(2. plot(t.y2) subplot(2.*cos(t).2.