Sie sind auf Seite 1von 6

PRÁCTICA N°5: REPRESENTACIÓN GRÁFICA DE FUNCIONES

DEFINIDAS POR UNA FÓRMULA

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:

Representar gráficamente, de forma rápida, funciones definidas por una


expresión matemática. Tienen solo un pequeño número de parámetros que se
pueden especificar. Cuando se necesite hacer graficas de funciones que no
vienen definidas por una fórmula habrá que recurrir a dichas funciones más
generales.

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')

EJERCICIO N°2: COMANDO MARKER

>> x=[1:50];
>> y=3*x.^3+2*x.^2+x-2;

>> plot(x,y,'marker','*','color','blue','linestyle','-','markersize',5,'linewidth',5)
>>

EJERCICIO N°3: COMANDO HOLD ON

>> x=[1:50];
>> y=3*x.^3+2*x.^2+x-2;
>> plot(x,y)

>> hold on % SUSPENDER EL GRAFICO


>> title ('GRÁFICA LEVENSPIEL PARA EL CSTR')
>> xlabel('conversión')
>> ylabel('1/-ra')

EJERCICIO N°4: COMANDO SUBPLOT

>> 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.

Das könnte Ihnen auch gefallen