Tarea MATLAB

13
MATLAB 1) Evaluar la operaciones de adición, multiplicación, división, hallar las raíces, polinomios (poner los ejemplos). ADICIÓN >> 24+51 ans = 75 MULTIPLICACIÓN >> 2*254 ans = 508 DIVISIÓN >> 158/25 ans = 6.3200 POLINOMIOS Y RAICES >> p1=[20 15 30 65 8] p1 = 20 15 30 65 8 >> r1=roots(p1) r1 = 0.3473 + 1.4871i 0.3473 - 1.4871i

description

labo hilda control

Transcript of Tarea MATLAB

MATLAB1) Evaluar la operaciones de adicin, multiplicacin, divisin, hallar las races, polinomios (poner los ejemplos).ADICIN>> 24+51ans = 75MULTIPLICACIN>> 2*254ans = 508DIVISIN>> 158/25ans = 6.3200POLINOMIOS Y RAICES>> p1=[20 15 30 65 8]p1 = 20 15 30 65 8>> r1=roots(p1)r1 = 0.3473 + 1.4871i 0.3473 - 1.4871i -1.3142 + 0.0000i -0.1305 + 0.0000i2) Crear la Funcin fun_xa que evalue la serie f(x) = 1 + x + x^2/2! + x^3/3! + +x^n/n!EN EDITOR CREANDO FUNCION func_xa.mfunction [b,h,ser]=fun_xa(x,n)h=1;for b=drange(1:n)h=h+((x.^b)/factorial(b));endhpause

3) Crear una funcin para hallar la impedancia de un ckto. serie RLC serie, datos R,L,C y WEN EDITOR CREANDO FUNCION RLC.mfunction [ Z, Fas ] = RLC(R,L,C,W)XC=1/(W*C);XL=W*L;Z=sqrt(R^2 + (XL-XC)^2);Fas=atan((XL-XC)/R);

end

4) Poner ejemplos de grficos bidimensionalesEjemplo1.>> t=0:2:300;>> x=(t-25).^4;>> plot(t,x,'o');

Ejemplo2.>> t=0:0.8:400;>> y=tan((2*t)/20);>> plot(t,y,'o');

5) Poner ejemplos de grficos tridimensionales

Ejemplo1.>> t=0:0.2:20;>> x=cos(t*pi);>> y=sin(3*t*pi);>> plot3(t,x,y,'o')

Ejemplo2.>> z = [ 1 2 3 4 5 6 7 8 9 10; 2 4 6 8 10 12 14 16 18 20 ;3 4 5 6 7 8 9 10 11 12] ;>> mesh(z)

6) Poner ejemplos de operaciones vectoriales>> t=3:2:9t = 3 5 7 9>> q=10:5:25q = 10 15 20 25>> y= t*2+q/5y = 8 13 18 23>> z=t'*2*q.^2

z = 600 1350 2400 3750 1000 2250 4000 6250 1400 3150 5600 8750 1800 4050 7200 11250

7) Poner ejemplo de operaciones matriciales.>> A=[1 2 3;4 5 6;7 8 9]A = 1 2 3 4 5 6 7 8 9>> B=zeros(3,5)B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>> C=10*rand(5)C = 8.1472 0.9754 1.5761 1.4189 6.5574 9.0579 2.7850 9.7059 4.2176 0.3571 1.2699 5.4688 9.5717 9.1574 8.4913 9.1338 9.5751 4.8538 7.9221 9.3399 6.3236 9.6489 8.0028 9.5949 6.7874>> F=diag([1,2,3,4,5],-1)F = 0 0 0 0 0 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 3 0 0 0 0 0 0 4 0 0 0 0 0 0 5 0>> D=floor(C)D = 8 0 1 1 6 9 2 9 4 0 1 5 9 9 8 9 9 4 7 9 6 9 8 9 6>> g=inv(A)Warning: Matrix is close to singular or badlyscaled. Results may be inaccurate. RCOND =1.541976e-18. g = 1.0e+16 *

-0.4504 0.9007 -0.4504 0.9007 -1.8014 0.9007 -0.4504 0.9007 -0.4504