Documentos de Académico
Documentos de Profesional
Documentos de Cultura
I. OBJETIVO.
Analizar el entorno MATLAB.
Conocer los fundamentos de MATLAB para aplicarlos en el cálculo y gráfico de funciones, y en la
implementación de programas sencillos.
II. PROCEDIMIENTO.
1. Uso de help.
1. A= rand(6)
Crea una matriz de orden 6x6, con términos que están entre 0 y 1.
A=
B=inv(A)
B=
B*A
ans =
1.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
-4 -3 -2 -1 0 1 2 3 4
x= inv(A) *B
3V1-2V2-V3-5=0
-20V1-+29V2-5V3=0
-2V1-V2+3V3-2=0
3 −2 −1 5
A= −20 29 −5 y B=0
−2 −1 3 2
X=inv(A)*B
X=
17.4
15
17.2
>> demo
>> A=[1 2 3; 4 5 6; 7 8 9]
A=
1 2 3
4 5 6
7 8 9
>> t=[0:.1:10];
>> t=linspace(0,10,11);
>> t=linspace(0,10);
>> t1=logspace(0,2,5);
>> t1=logspace(0,2);
Función
𝑃(𝑠) = 𝑠 3 + 2𝑠 2 + 3𝑠 + 4
>> p=[1 2 3 4]
>> r=roots(p)
r=
-1.6506
-0.1747 + 1.5469i
-0.1747 - 1.5469i
>> p2=poly([-1,-2])
p2 =
1 3 2
>> polyval(p,2.5)
ans =
39.6250
z=
8 26 20
q=
1 -2
r=
0 0 11
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
1 2 3 4 5 6 7
>> x=0:.05:5;y=sin(x.^2);plot(x,y)
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
>> y1=sin(x1);y2=cos(x2);y3=log(x3);
>> plot(x1,y1,x2,y2,x3,y3)
3.5
2.5
1.5
0.5
-0.5
-1
0 5 10 15 20 25 30
>> subplot(211);plot(y1);
>> subplot(212);plot(y2);
0.5
-0.5
-1
0 20 40 60 80 100 120
50
-50
-100
0 20 40 60 80 100 120
>> subplot(221);plot(x,y);title('Polinomio-lineal/lineal');ylabel('y');grid;
>> subplot(222);semilogx(x,y);title('Polinomio-log/lineal');ylabel('y');grid;
>> subplot(223);semilogy(x,y);title('Polinomio-lineal/log');ylabel('y');xlabel('x');grid;
>> subplot(224);loglog(x,y);title('Polinomio-log/log');ylabel('y');xlabel('x');grid;
Polinomio-lineal/lineal Polinomio-log/lineal
15000 15000
10000 10000
y
5000 5000
0 0
0 20 40 60 -2 0 2
10 10 10
5
Polinomio-lineal/log 5
Polinomio-log/log
10 10
y
0 0
10 10
0 20 40 60 -2 0 2
10 10 10
x x
>> plot(t,u);title('escalon unitario');ylabel('u(t)'); axis([-2 5 0 2]); % indica los valores de límites para la
figura
escalon unitario
2
1.8
1.6
1.4
1.2
u(t)
0.8
0.6
0.4
0.2
0
-2 -1 0 1 2 3 4 5
>> plot(t,u);title('escalon unitario');ylabel('u(t)'); axis([-2 5 0 2]); % indica los valores de límites para la
figura
escalon unitario
2
1.8
1.6
1.4
1.2
u(t)
0.8
0.6
0.4
0.2
0
-2 -1 0 1 2 3 4 5
>> t=-6:.01:6;
>> T=0
>> x=stepfun(t,T); % funcion Escalon t , T donde el Escalon se produce a la mitad del dominio.
>> plot(t,x);
1.5
1
x(t)
0.5
0
-6 -4 -2 0 2 4 6
t
>> t=-6:.01:6;
>> T=0
>> x=stepfun(t,T); % funcion Escalon t , T donde el Escalon se produce a la mitad del dominio.
>> plot(t,x);
1.5
1
x1(t)
0.5
0
-6 -4 -2 0 2 4 6
>> t=-6:.01:6;
>> u(101,501)=1;
>> plot(t,u);
>> t=-6:.01:6;
>> u(101,501)=sin(t);
>> plot(t,u);
4. OBSERVACIONES Y CONCLUSIONES
Se explicó la interface del MATLAB, para graficas de escalón unitario, y sus aplicaciones.
Se logro obtener diferentes tipos de respuestas para sistemas electrónicos, y funciones.