Beruflich Dokumente
Kultur Dokumente
OBJETIVO:
Aplicar la función PLOT para la representación gráfica de funciones definidas
por una fórmula.
MARCO TEÓRICO
La función PLOT en el entorno de Matlab significa:
SINTAXIS
EQUIPOS
Equipo de cómputo con el software Matlab instalado.
PROCEDIMIENTO
EJERCICIO N°1: REPRESETACIÓN GRÁFICA DE UNA FUNCIÓN CÚBICA
>> x=[1:50];
>> y=3*x.^3+2*x.^2+x-2;
>> subplot(2,2,1);plot(x,y,'o')
>> subplot(2,2,2);plot(x,y,'*')
>> subplot(2,2,3);plot(x,y,'+')
>> subplot(2,2,4);plot(x,y,'red')
>> x=[1:50];
>> y=3*x.^3+2*x.^2+x-2;
>> plot(x,y,'marker','*','color','blue','linestyle','-','markersize',5,'linewidth',5)
>>
>> x=[1:50];
>> y=3*x.^3+2*x.^2+x-2;
>> plot(x,y)
>> x=[1:2:100];
>> y1=3*x+1;
>> y2=3*x.^2+1;
>> y3=sin(x/2);
>> y4=cos(3*x);
>> y5=log(x);
>> y2=-x.^2+1;
>> subplot(3,2,1);plot(x,y1),'color','blue','marker','*','linestyle','-
',title('velocidad vs tiempo'),xlabel('tiempo'),ylabel('velocidad');grid on
>> subplot(3,2,2);plot(x,y2),'color','green','marker','*','linestyle','-',title('Gráfica
Levenspiel'),xlabel('conversion'),ylabel('1/-ra');grid on
>> subplot(3,2,3);plot(x,y3),'color','black','marker','*','linestyle','o',title('Energia de
activación'),xlabel('reactivos'),ylabel('energia potencial');grid on
>> subplot(3,2,4);plot(x,y4),'color','black','marker','*','linestyle','-',title('Espectro
visible'),xlabel('longitud de onda'),ylabel('tiempo');grid on
>> subplot(3,2,5);plot(x,y5),'color','blue','marker','*','linestyle','-
',title('concentración de peroxido'),xlabel('porcentaje de
peroxido'),ylabel('muestra');grid on
>> subplot(3,2,6);plot(x,y6),'color','cyan','marker','*','linestyle','-
',title('concentración de peroxido'),xlabel('porcentaje de
peroxido'),ylabel('muestra');grid on
CONCLUSIONES
Se declaró variables en el entorno de Matlab, para asi aprovechar la función
PLOT en la representación gráfica en dos dimensiones. Colocando títulos y
dando formato a la representación de las curvas.
OBSERVACIONES
- Las variables declaradas en el entorno de trabajo de Matlab, asumen el ultimo
valor que se les otorgue, por lo que se debe tener cuidado en no repetir
variables.
BIBLIOGRAFIA
Rosa Echevarría Líbano – Dpto. Ecuaciones Diferenciales y Análisis Numérico
– Universidad de Sevilla.