Sei sulla pagina 1di 29

Prof.

ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

INTRODUCCIN

MATLAB es el nombre abreviado de MATriz LABoratory. Es un programa para


realizar clculos numricos con vectores y matrices, y por tanto se puede trabajar
tambin con nmeros escalares (tanto reales como complejos), con cadenas de
caracteres y con otras estructuras de informacin ms complejas.

Matlab es un lenguaje de alto rendimiento para clculos tcnicos, es al mismo


tiempo un entorno y un lenguaje de programacin. Uno de sus puntos fuertes es que
permite construir nuestras propias herramientas reutilizables. Podemos crear fcilmente
nuestras propias funciones y programas especiales (conocidos como M - archivos) en
cdigo Matlab, los podemos agrupar en Toolbox (tambin llamadas libreras): coleccin
especializada de M - archivos para trabajar en clases particulares de problemas.

Matlab, a parte del clculo matricial y lgebra lineal, tambin puede manejar
polinomios, funciones, ecuaciones diferenciales ordinarias, diferentes tipos de grficos.
Tenemos la pantalla abierta para poder trabajar.

1
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

SESIN 01: COMANDOS ELEMENTALES: Tenemos una relacin de comandos que se


emplean en Matlab, estos son los ms comunes

+ : Adicin ejemplo: 3 + 2
- : Sustraccin ejemplo: 9 5
* : Multiplicacin ejemplo: 5 * 7
/ : Divisin ejemplo: 5 / 9
\ : Divisin inversa ejemplo: 4 \ 5, divide 5 entre 4 (Alt + 92)
^ : Exponente ejemplo: 6^2 = 6 2 (Alt + 94)
~= : Diferente ejemplo: 3 5 (para ~ hacer Alt + 126)
> : Mayor
< : Menor
>= : Mayor o igual
<= : Menor o igual
& : y operador lgico
| : o operador lgico (Alt + 124)
== : igual operador lgico
[ : Abrir corchete (hacer Alt + 91)
] : Cerrar corchete (hacer Alt + 93)
: Apstrofe (hacer Alt + 39)

VARIABLES: En Matlab como en cualquier otro lenguaje de programacin, se utilizan


variables. Las variables deben tener un nombre segn ciertas reglas. Estas son:

*) No pueden comenzar con un nmero, aunque si pueden tener nmeros (ejemplo: N1


es vlido)

*) Las maysculas y minsculas se diferencian en los nombres de variables (A y a son


dos variables diferentes.

Ejemplo: Nombre de la variable Significado


pi
I 1
inf
eps 2,22046 16 (Epsilon)

FUNCIONES MATEMTICAS EN MATLAB: Es importante recordar los siguientes comandos


para escribir funciones, para esto generalizamos haciendo u u( x) una funcin.

Nota: Es importante escribir correctamente las funciones en Matlab, para no tener


dificultades al operar y graficar con funciones.

2
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

A) FUNCIONES TRIGONOMTRICAS INVERSAS - HIPERBLICAS

FUNCIN INVERSA FUNCIONES INVERSAS


TRIGONOMTRICA TRIGONOMTRICA HIPERBLICAS HIPERBLICAS
sin( u ) asin( u ) sinh( u ) asinh( u )
cos( u ) acos( u ) cosh( u ) acosh( u )
tan( u ) atan( u ) tanh( u ) atanh( u )
cot ( u ) acot ( u ) coth ( u ) acoth ( u )
sec( u ) asec( u ) sech( u ) asech( u )
csc( u ) acsc( u ) csch( u ) acsch( u )

B) FUNCIONES EXPONENCIALES Y LOGARTMICAS

FUNCIN SIGNIFICADO
exp( u ) Funcin exponencial y eu
log( u ) Funcin logaritmo natural (base e) y ln(u)
log10( u ) Funcin logaritmo en base 10 y log (u)
log2( u ) Funcin logaritmo en base 2 y log 2 (u)
sqrt( u ) Funcin raz cuadrada y u
abs( u ) Funcin valor absoluto y u
sign( u ) Funcin signo y sig (u)

EJEMPLOS: Escribir (Codificar) en Matlab las siguientes funciones


y x 2 3x y e x sen ( x)
>> y=x.^2-3*x; >> y=exp(x).*sin(x);
y x 4x
2 y ln( x 1)
>> y=log(x-1);
>> y=abs(x.^2- 4*x);
y 4x 2 y ln(1 x2 )
>> y=sqrt(4*x-2); >> y=log(1-x.^2);
ex 1 x2 x
y ln x y
e 1 1 x2
>> y=log((exp(x)+1)./(exp(x)-1)); >> y=(x.^2-x)./(1+x.^2);
y e x senh ( x) y ( x 2 2 x) e x
>> y=exp(-x).*sinh(x); >> y=(x.^2+2*x).*exp(x)
y e2 x arcsenh ( x) x2 4
y
>> y=exp(2*x).*asinh(x); x2
>> y=(x.^2+4)./(x-2)
y x sen (1/ x) y x3 e x
>> y=x.*sin(1./x); >> y=(x.^3)+exp(x)

3
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

Ahora reforzaremos la leccin aprendida, para el cul presentamos un listado de


funciones

EJERCICIOS: Escribir (Codificar) en Matlab las siguientes funciones


01. y 3x x 2 02. y x 2 x

>> >>
2x x 1
2
3x
03. y 04. y arccos arctgh(2 x 2 )
x 2 3x 2

>> >>
05. y x3e82x 06. y arctgh (2 x 2 )
2

>> >>
2x x2 x
07. y 08. y
1 x2 1 x2

>> >>
09. y x sen (1/ x)
2
10. y
ln( x)
4x
>>
>>
11. y x3 4 x 12. y x e x
2

>> >>
x 2
13. y 14. y
1 x e e x
x

>> >>
1 2x
15. y 16. y
3
3x 1 x 1
2

>> >>
x3 1 x
17. y 18. y
6 2x x2 9
>> >>
3
x 1 x3 1
19. y 20. y
6 2x 6 2x
>> >>

4
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

2
SESIN 02: GRFICO DE FUNCIONES REALES DE VARIABLE REAL EN :

SINTAXIS

>> x=a:s:b; Escribimos el dominio de la funcin


>> y=..; Se escribe la funcin " y "
>> plot(x,y) Grafica la funcin y f ( x)
>> grid Agrega el papel cuadriculado

NOTA: El comando grid grafica lneas horizontales y verticales en la grfica

EJEMPLOS: Graficar las siguientes funciones


01. y 3x x 2

>> x=-20:0.001:20;
>> y=3*x-x.^2;
>> plot(x,y)
>> grid

02. y x 2 1 4

>> x=-2:0.001:2;
>> y=abs(x.^2-1)+4;
>> plot(x,y)
>> grid

3 8 2x2
03. y x e

>> x=-2.5:0.001:2.5;
>> y=(x.^3).*exp(8-2*x.^2);
>> plot(x,y)
>> grid

5
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

04. y arctg (2 x 2 )

>> x=-pi:0.001:pi;
>> y=atan(2*x.^2);
>> plot(x,y)
>> grid

ex 1
05. y ln x
e 1

>> x=0:0.005:1.5;
>> y=log((exp(x)+1)./(exp(x)-1));
>> plot(x,y)
>> grid

06. y x 2 x

>> x=-5:0.005:5;
>> y=sqrt(x.^2+abs(x));
>> plot(x,y)
>> grid

07. y x3 4 x

>> x=-4:0.005:4;
>> y=abs(x.^3-4*x);
>> plot(x,y)
>> grid

Opciones: Presentamos algunas opciones que me permite al graficar funciones.


6
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

a) plot (x, y, * ); grafica los puntos con estrellas (*) sin estar conectados por lneas.
Existen cinco opciones en este tipo:
1) . punto 2) + ms 3) * asterisco 4) o circunferencia 5) x equis

b) plot (x, y, *r ); grafica los puntos con estrellas (*) de color rojo. Existen ocho
opciones en este tipo:
1) r rojo 2) y amarillo 3) g verde 4) b azul
5) w blanco 6) m magenta 7) c turquesa 8) k negro

Ejemplo 01: Graficar la funcin de color


verde
y arctg (2 x 2 )

>> x=-pi:0.001:pi;
>> y=atan(2*x.^2);
>> plot(x,y,'+g')
>> grid

Ejemplo 01: Graficar la funcin de color


rojo
y x3 4 x

>> x=-4:0.005:4;
>> y=abs(x.^3-4*x);
>> plot(x,y,'*r')
>> grid

Ejemplo 01: Graficar la funcin de color


azul
y tan(2 x)

>> x=-pi:0.05:pi;
>> y=tan(x);
>> plot(x,y,'b')
>> grid

7
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

GRFICO DE FUNCIONES POR TRAMOS: Para esto tener presente los siguientes
comentarios

*) El comando linspace permite generar vectores con un nmero determinado de


elementos equi espaciados.

Ejemplo: genera el siguiente vector


>> linspace(0,1,5) (genera el siguiente vector con 5 puntos)
ans =
0 0.2500 0.5000 0.7500 1.0000

2 ; x 1

Ejemplo 01: Hacer el grfico para la siguiente funcin f (x) x 1; 1 x 1
2 ; x 1

Solucin:
>> x=linspace(-4,4,2000);
>> y=(-2).*(x<=-1)+(x-1).*((-1<x)&(x<1))+2.*(1<=x);
>> plot(x,y,'.'),grid on,title('FUNCIN DEFINIDA A TROZOS')

2x 2 1; 3 x 1
Ejemplo 02: Hacer el grfico para la siguiente funcin f (x)
2x 3 ;1 x 3
Solucin:
>> x=linspace(-3,3,1000);
>> y=((2*x.^2)-1).*((-3<=x)&(x<=1))+(2*x+3).*((1<=x)&(x<=3));
>> plot(x,y,'.'),grid on,title('FUNCIN DEFINIDA A TROZOS; DIME SI TE ENCANTA')

8
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

x 3 ; x 1

Ejemplo 03: Hacer el grfico para la siguiente funcin f (x) 4 x 2 ; 1 x 1
3 ; x 1

Solucin:
>> x=linspace(-3,4,1000);
>> y=(-x.^3).*(x<=-1)+(4-x.^2).*((-1<x)&(x<1))+(-3).*(1<=x);
>> plot(x,y,'.'),grid on,title('FUNCIN DEFINIDA A TROZOS; TE ENCANT')

ACTIVIDAD 01
Codificar correctamente y graficar las siguientes funciones e indicar el dominio
adecuado:
01. y x 2 4 x 02. y 2 x 4

>> >>

>> >>

>> >>
03. y ln(2 x) 04. y 3x 2

>> >>

>> >>

>> >>

9
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

05. y arctg (3x 2) 06. y x3 3x 2 2 x

>> >>
>> >>
>> >>

07. y 4 x 4 3x 2 2 x 5 08. y 2 x3 x 2 5x 6

>> >>

>> >>

>> >>

09. y x 4 x 2 10. y 3x x 2

>> >>

>> >>

>> >>

11. y ln( x 2 4) 12. y e x 2 x

>> >>

>> >>

>> >>

13. y x3 4 x 2 14. y x 2 2 x 2

>> >>

>> >>

>> >>

15. y ln( x 1) ; x 2; e2 1 16. y ln(1 x 2 ) ; x 1/ 4 ;3 / 4

>> >>

>> >>

>> >>

10
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

tg(x) ;/4 x /4 x 2 x ; si x 4;0



17. f (x) cos(x / 4) ; / 4 x / 2 18. f (x) 4 x ;si x 0; 4
e x ;/2x3
2x 8 ; si x 4;10

>> >>

>> >>

>> >>


x 2x
2
; x
3; 1 x 3 ; si x 6;0
19. f (x)
20. f (x) 2(x 1) 2 ;si x 0; 2
2 3 2x x ; x 1;1

2


2 x 4 ; si x 2;10

>>
>>
>>
>>
>>
>>

x 2 10x 21; x 5; 1
x 2 ;si x 2;6
22. f (x)
21. f (x) x 2 1
x 2x 3; si x 1;1

2

x 3 ; x 1; 2

>> >>

>> >>

>> >>

11
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

SESIN 03: GRFICO DE DOS O MS FUNCIONES EN EL MISMO PLANO CARTESIANO:

GRFICO DE DOS FUNCIONES EN EL MISMO PLANO CARTESIANO


>> x=a:s:b; Escribimos el dominio de la funcin
>> y=..; Se escribe la primera funcin " y "
>> z=..; Se escribe la segunda funcin " z "
>> plot(x,y,x,z) Grafica la funcin
>> grid Agrega el papel cuadriculado

EJEMPLOS: Graficar las siguientes funciones en el mismo plano


01. y 3 x2 ; y x 1 ; x 3;3

>> x=-3:0.001:3;
>> y=3-x.^2;
>> z=-x+1;
>> plot(x,y,x,z)
>> grid

ln( x)
02. y ; y x ln( x) ; x 0.4 ; 1.2
4x

>> x=0.4:0.001:1.2;
>> y=(log(x))./(4*x);
>> z=x.*log(x);
>> plot(x,y,x,z)
>> grid

03. y 4 x2 ; y 4 4 x ; x 1;5

>> x=-1:0.001:5;
>> y=4-x.^2;
>> z=4-4*x;
>> plot(x,y,x,z)
>> grid

12
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

1 x2
04. y ; y ; x 2; 2
1 x2 2

>> x=-2:0.001:2;
>> y=1./(1+x.^2);
>> z=(x.^2)/2;
>> plot(x,y,x,z)
>> grid

05. y x3 3x ; y x ; x 3 ; 3

>> x=-3:0.001:3;
>> y=x.^3-3*x;
>> z=x;
>> plot(x,y,x,z)
>> grid

06. y 4 x2 ; y 4 4 x ; x 1;5

>> x=-1:0.001:5;
>> y=4-x.^2;
>> z=4-4*x;
>> plot(x,y,x,z)
>> grid

07. y x3 4 x 2 x 6 ; 3 y x 2 0
x 0;4

>> x=0:0.01:4;
>> y=abs((x.^3)-(4*x.^2)+x+6);
>> z=-(x.^2)/3;
>> plot(x,y,x,z)
>> grid

13
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

GRFICO DE TRES FUNCIONES EN EL MISMO PLANO CARTESIANO


>> x=a:s:b; Escribimos el dominio de la funcin
>> y=..; Se escribe la primera funcin " y "
>> z=..; Se escribe la segunda funcin " z "
>> w=..; Se escribe la segunda funcin " w "
>> plot(x,y,x,z,x,w) Grafica la funcin
>> grid Agrega el papel cuadriculado

EJEMPLOS: Graficar las siguientes funciones en el mismo plano


01. y x2 ; y 8 x2 ; 4 x y 12 0
x 6;8

>> x=-6:0.001:8;
>> y=x.^2;
>> z=8-x.^2;
>> w=4*x+12;
>> plot(x,y,x,z,x,w)
>> grid

02. y x3 4 x ; y x ; y x
x 3;3

>> x=-3:0.001:3;
>> y=x.^3-4*x;
>> z=x;
>> w=-x;
>> plot(x,y,x,z,x,w)
>> grid

03. y x2 ; y 2 x 1 ; y 4 0
x 0.25 ; 2.75

>> x=0.25:0.001:2.75;
>> y=x.^2;
>> z=2*x-1;
>> w=4;
>> plot(x,y,x,z,x,w,'r')
>> grid

14
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

EJERCICIOS: Completar y graficar las siguientes funciones en el mismo plano


01. y cos(2 x); y cos(4 x); x 0;2 Grfico:

>> x=

>> y=

>> z=

>> plot
>> grid
02. y x3 6 x ; y x3 4 x 2 ; x 2;4 Grfico:

>> x=

>> y=

>> z=

>> plot
>> grid
03. y 30sen(2 x); y x(6 x)2 ; x 2;8 Grfico:

>> x=

>> y=

>> z=

>> plot
>> grid
x2 1 Grfico:
04. y 2 ; y 9 x 2 9; x 1.5;1.5
x 1/ 4
>> x=

>> y=

>> z=

>> plot
>> grid

15
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

3x 2 13x 4 2 x 2 4 x 10 Grfico:
05. y ; y
5 3
3x 12
y ; x 5;3
2

>> x=

>> y=

>> z=

>> w=

>> plot

>> grid

06. y x3 12 x ; y x ; y x Grfico:
x 5;5

>> x=

>> y=

>> z=

>> w=

>> plot

>> grid

07. y cos x ; y cos 2 x ; y cos 4 x Grfico:


x 0 ; 2

>> x=

>> y=

>> z=

>> w=

>> plot

>> grid

16
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

SESIN 04: GRFICO DE RELACIONES Y FUNCIONES IMPLCITAS:

El comando ezplot dibuja curvas como plot en cartesianas y paramtricas de una manera
ms sencilla ya que genera automticamente los valores de la variable independiente.
Tambin se utiliza para dibujar curvas en implcitas. Utiliza el intervalo 2 ; 2 por
defecto.

>> ezplot('cos(x)'),grid

>> ezplot('atan(x)'),grid

Tomando otro intervalo en la variable independiente

>> ezplot('x*sin(1/x)',[-0 pi/2]),grid

Ahora indicamos la sintaxis para graficar empleando este comando.


17
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

SINTAXIS
>> ezplot('') Dado la ecuacin f ( x, y) 0 , entonces grafica
la funcin f ( x, y) para un dominio por
defecto
>> ezplot('',[a b]) Dado la ecuacin f ( x, y) 0 , entonces grafica
la funcin f ( x, y) en el intervalo a ; b

EJEMPLOS: Graficar las siguientes funciones dadas implcitamente


01. y3 y 2 5xy x 2 x y 0

>> ezplot('y^3+y^2+5*x*y+x^2+x+y')
>> grid

02. 4 y3 27 x 2

>> ezplot('-27*x^2+4*y^3')
>> grid

03. xy 1 0

>> ezplot('x*y-1')
>> grid

18
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

04. (2 x) y 2 (2 x) x2

>> ezplot('((2+x)*y^2)-((2-x)*x^2)')
>> grid

05. y x2 sen(1/ x) ; x 0.05 0.05

>> ezplot('x^2*sin(1/x)',[-0.05 0.05])


>> grid

06. x2 sen( x y) 5 ye x 3 ; x 8 ; 8

>> ezplot('(x^2*sin(x+y))-5*y*exp(x)-3',[-8 8])


>> grid

07. ( x2 y 2 )3 ( x2 y 2 )2 ; x 1.5 ; 1.5

>> ezplot('(x^2+y^2)^3-(x^2-y^2)^2',[-1.5 1.5])


>> grid

19
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

OBSERVACIN: Despus de haber graficado una o ms curvas, se puede incrementar una


curva en los mismos ejes procediendo con el comando (hold on), al uso de plot.

Ejemplo 01: Graficar las siguientes funciones y sen ( x) ; y cos( x) ; 8;8 luego
agregar el grfico de la funcin y x 2 2
Solucin:
>> x = -8:0.05:8;
>> y = sin(x);
>> z = cos(x);
>> plot (x, y, x, z);
>> hold on
>> w = abs(x - 2) - 2;
>> plot (x, w, 'r');
>> grid

OPCIONES: Podemos mejorar el grfico asimismo un toque artstico, para esto


empleamos los siguientes comandos.
x label : Coloca nombre al eje X
y label : Coloca nombre al eje Y
title : Coloca Ttulo a la Grfica

Ejemplo 02: Graficar las siguientes funciones y sen ( x) ; y cos( x) ; 0;5 Agregar
los Ejes de Coordenadas y ttulo al grfico anterior.
Solucin:
>> x = 0:0.05:5;
>> y = sin(x);
>> z = cos(x);
>> plot (x, y, x, z);
>> grid
>> xlabel ('Eje X');
>> ylabel ('Eje Y');
>> title ('Grfica con Matlab');

Se verifica en la grfica y observar que se ha mejorado

20
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

Ejemplo 03: Graficar en el mismo plano las funciones y sen ( x) , y cos( x) . Luego

agregar el grfico de la siguiente funcin x 2 y 2 16 , x 8 ; 8

Solucin:
>> x=-8:0.01:8;
>> y=cos(x);
>> z=sin(x);
>> plot(x,y,x,z)
>> hold on
>> ezplot('x^2+y^2-16')
>> grid

ACTIVIDAD 02
Codificar y graficar las siguientes funciones dadas implcitamente
01. x3 xy y3 0; x [2;2] Grfico:

02. 2 x2 xy y 2 8 0; x [4;4] Grfico:

21
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

03. y 2 5x xe x ( y 2) ; x [8;8] Grfico:

04. e y x y Grfico:

y 1 Grfico:
05. arctg ln( x 2 y 2 ) ; x [4; 4]
x 2

22
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

x y Grfico:
06. y 3 ; x [10;8]
x y

07. x sen( y) cos( y) cos(2 y) Grfico:


x [ 4;4]

08. x y arcsen ( x) arcsen ( y) Grfico:

23
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

SESIN 05: GRFICO DE FUNCIONES VECTORIALES Y EN COORDENADAS POLARES:


A) Grfico de Funciones Vectoriales de Variable Real

SINTAXIS
>> ezplot('', ''); Grafica funciones vectoriales de la
forma f (t ) ( f1 (t ) ; f 2 (t )) con dominio
por defecto
>> ezplot('', '',[a b]); Grafica funciones de la forma
f (t ) ( f1 (t ) ; f 2 (t )) en el intervalo
a ; b
>> ezplot3('', '', ''); Grafica funciones de la forma
f (t ) ( f1 (t ) ; f 2 (t ); f3 (t )) con dominio
por defecto
>> ezplot3('', '', '', 'animate'); Dibuja la curva en 3

f (t ) ( f1 (t ) ; f 2 (t ); f3 (t )) con dominio
por defecto y progresivamente
>> ezplot3('', '', '',[a b]); Dibuja la curva en 3

f (t ) ( f1 (t ) ; f 2 (t ); f3 (t )) en el
intervalo a ; b
>> ezplot3('', '', '',[a b], 'animate'); Dibuja la curva en 3

f (t ) ( f1 (t ) ; f 2 (t ); f3 (t ))
progresivamente en el intervalo a ; b

EJEMPLOS: Graficar las siguientes funciones vectoriales de la forma


f (t ) ( f1 (t ) ; f 2 (t ))
01. f (t ) (et cos(2 t ); et sen (2 t ))

>>ezplot('exp(-t)*cos(2*pi*t)','exp(-
t)*sin(2*pi*t)');
>> grid

Nota: Tambin se puede escribir

>> syms t;
>> y=exp(-t)*cos(2*pi*t);
>> z=exp(-t)*sin(2*pi*t);
>> ezplot(y,z);
>> grid

24
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

02. f (t ) (2cos(t ); 2sen (t ))

>> ezplot('2*cos(t)','2*sin(t)');
>> grid

03. f (t ) (t sen (t ); t cos (t ))

>> ezplot('t*sin(t)','t*cos(t)');
>> grid

04. f (t ) (et cos (t ); et sen (t ))


t ; 2

>> ezplot('exp(t)*cos(t)','exp(t)*sin(t)',[-pi
2*pi]);
>> grid

05. f (t ) (3t t 2 ;3t 2 ) ; t 2;6

>> ezplot('3*t-t^2','3*t^2',[-2 6]);


>> grid

25
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

EJEMPLOS: Graficar las siguientes funciones vectoriales de la forma


f (t ) ( f1 (t ) ; f 2 (t ) ; f3 (t ))
01. f (t ) ( sen (t );cos (t ); t )

>> ezplot3('sin(t)','cos(t)','t');

02. f (t ) (t cos (t ); t sen (t ); t )

>> ezplot3('t*cos(t)','t*sin(t)','t');

03. f (t ) (t cos (t ); t sen (t ); t )

Nota: Graficamos con animacin

>> ezplot3('t*cos(t)','t*sin(t)','t','animate');

04. f (t ) (2t ; t 2 ;ln(t ))

Nota: Graficamos con animacin

>> ezplot3('2*t','t^2','log(t)','animate');

26
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

05. f (t ) ( sen (t );cos (t ); t )


t 2 ;4

>> ezplot3('sin(t)','cos(t)','t',[-2*pi 4*pi]);

03. f (t ) (et cos (t ); et sen (t ); tet )


t ; 4

>>
ezplot3('exp(t)*cos(t)','exp(t)*sin(t)','t*exp(t)
',[-pi 4*pi],'animate');

04. f (t ) (1 2t ; t 2 ; 2e(2t 2) )
t 2;8

>>ezplot3('1-2*t','t^2','2*exp(2*t-2)',[-2 8],
'animate');

05. f (t ) (t ; t ; sen (t )) ; t 2 ; 4

>>ezplot3('t','t','sin(t)',[-2*pi 4*pi],'animate');

27
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

B) Grfico de Funciones en Coordenadas Polares


SINTAXIS

>> t=a:s:b; (Se escribe el dominio de la funcin)


>> r=..; (Se escribe la funcin " y " en Matlab)
>> polar (t,r); (Comando para graficar en coordenadas polares)
>> grid (Agrega el papel cuadriculado)

EJEMPLOS: Graficar las siguientes funciones dadas en coordenadas polares


01. r sen (2t ) cos (2t )

>> t = 0:0.01:2*pi;
>> r = abs (sin(2*t).*cos(2*t));
>> polar (t,r);

02. r 2 2 sen (t )

>> t = -2*pi:0.01:2*pi;
>> r=2-2*sin(t);
>> polar (t,r);

03. r 2cos (5 t )

>> t=-2*pi:0.01:2*pi;
>> r=2*cos(5*t);
>> polar (t,r);

28
Prof. ISIDRO REYNALDO MUNAYA SANCHEZ FACULTAD DE INGENIERIA MECANICA

04. r 2sen (3t )

>> t = -2*pi:0.01:2*pi;
>> r = 2*sin(3*t);
>> polar (t,r);

05. r 1 2 sen (3t )

>> t = -2*pi:0.01:2*pi;
>> r=2-2*sin(t);
>> polar (t,r);

t
06. r 1 2 sen
2

>> t=-2*pi:0.01:2*pi;
>> r=1+2*sin(t/2);
>> polar (t,r);

29

Potrebbero piacerti anche