You are on page 1of 29

Prof.

Ricardo Gutirrez Tirado

FIEE - UNAC

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.

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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


emplean en Matlab, estos son los ms comunes
+
*
/
\

:
:
:
:
:

Adicin
Sustraccin
Multiplicacin
Divisin
Divisin inversa

ejemplo: 3 + 2
ejemplo: 9 5
ejemplo: 5 * 7
ejemplo: 5 / 9
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
pi

Significado

I
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. Ricardo Gutirrez Tirado

FIEE - UNAC

A) FUNCIONES TRIGONOMTRICAS INVERSAS - HIPERBLICAS


FUNCIN
TRIGONOMTRICA
sin( u )
cos( u )
tan( u )
cot ( u )
sec( u )
csc( u )

INVERSA
TRIGONOMTRICA
asin( u )
acos( u )
atan( u )
acot ( u )
asec( u )
acsc( u )

FUNCIONES
HIPERBLICAS
sinh( u )
cosh( u )
tanh( u )
coth ( u )
sech( u )
csch( u )

INVERSAS
HIPERBLICAS
asinh( u )
acosh( u )
atanh( u )
acoth ( u )
asech( u )
acsch( u )

B) FUNCIONES EXPONENCIALES Y LOGARTMICAS


FUNCIN
exp( u )
log( u )

SIGNIFICADO
Funcin exponencial y eu
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 ln( x 1)

y x 4x
2

>> 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
y ln x
e 1
>> y=log((exp(x)+1)./(exp(x)-1));

x2 x
y
1 x2
>> 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 e arcsenh ( x)

>> y=exp(2*x).*asinh(x);

x2 4
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)

2x

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

>>

>>

03. y

3x
04. y arccos arctgh(2 x 2 )
2

2x2 x 1
x 2 3x

>>

>>

05. y x e

06. y arctgh (2 x2 )

>>

>>

3 8 2x2

07. y

2x

08. y

1 x2

>>

x2 x
1 x2

>>

09. y x sen (1/ x)


2

10. y

>>

ln( x)
4x

>>

11. y x 4 x

12. y x e x

>>

>>

13. y

x
1 x

14. y

2
e e x
x

>>

>>
15. y

1
3
3x 1

16. y

>>

>>

x3 1

17. y
6 2x

18. y

>>

>>
3

2x
x2 1

x
x2 9

x
1

19. y
6 2x

x3 1

20. y
6 2x

>>

>>

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

SESIN 02: GRFICO DE FUNCIONES REALES DE VARIABLE REAL EN

SINTAXIS
>> x=a:s:b;
>> y=..;

Escribimos el dominio de la funcin


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 2x
03. y x e

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

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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


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

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

>>

>>

>>

>>

>>

>>

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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. Ricardo Gutirrez Tirado

FIEE - UNAC

tg(x)
;/4 x /4

17. f (x) cos(x / 4) ; / 4 x / 2


e x
;/2x3

x 2 x ; si x 4;0

18. f (x) 4 x ;si x 0; 4

2x 8 ; si x 4;10

>>

>>

>>

>>

>>

>>

x 2 2x
; x
3; 1
19. f (x)
2
2 3 2x x ; x 1;1

x 3
; si x 6;0

20. f (x) 2(x 1) 2 ;si x 0; 2

2 x 4 ; si x 2;10

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

x 2 10x 21; x 5; 1

21. f (x) x 2 1
; x 1; 2
x 3

x 2 ;si x 2;6
22. f (x)
2

x 2x 3; si x 1;1

>>

>>

>>

>>

>>

>>

11

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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=..;
>> plot(x,y,x,z)
>> grid

Se escribe la segunda funcin " z "


Grafica la funcin
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

02. y

ln( x)
; 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. Ricardo Gutirrez Tirado


04. y

FIEE - UNAC

1
x2
;
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. Ricardo Gutirrez Tirado

FIEE - UNAC

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=..;
>> w=..;
>> plot(x,y,x,z,x,w)
>> grid

Se escribe la segunda funcin " z "


Se escribe la segunda funcin " w "
Grafica la funcin
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. Ricardo Gutirrez Tirado

FIEE - UNAC

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

x2 1
; y 9 x 2 9; x 1.5;1.5
2
x 1/ 4

Grfico:

>> x=
>> y=
>> z=
>> plot
>> grid

15

Prof. Ricardo Gutirrez Tirado

3x 2 13x 4
2 x 2 4 x 10
; y
5
3
3x 12
y
; x 5;3
2

05. y

FIEE - UNAC
Grfico:

>> 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. Ricardo Gutirrez Tirado

FIEE - UNAC

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. Ricardo Gutirrez Tirado

>> ezplot('')

FIEE - UNAC
SINTAXIS
Dado la ecuacin f ( x, y) 0 , entonces grafica
la funcin

>> ezplot('',*a b+)

f ( x, y) para un dominio por

defecto
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 x2 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. Ricardo Gutirrez Tirado

FIEE - UNAC

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

05. y x 2 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. Ricardo Gutirrez Tirado

FIEE - UNAC

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. Ricardo Gutirrez Tirado

FIEE - UNAC

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
Grfico:
01. x3 xy y3 0; x [2;2]

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

Grfico:

21

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

Grfico:

04. e y x y

Grfico:

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

Grfico:

22

Prof. Ricardo Gutirrez Tirado

06. y 3

x y
; x [10;8]
x y

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

FIEE - UNAC

Grfico:

Grfico:

x [ 4;4]

08. x y arcsen ( x) arcsen ( y)

Grfico:

23

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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


A) Grfico de Funciones Vectoriales de Variable Real
SINTAXIS
Grafica funciones vectoriales de la

>> ezplot('', '');

forma f (t ) ( f1 (t ) ; f 2 (t )) con dominio


por defecto
Grafica funciones

>> ezplot('', '',*a b+);

de

f (t ) ( f1 (t ) ; f 2 (t ))

la

forma

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

f (t ) ( f1 (t ) ; f 2 (t ); f3 (t )) con dominio
por defecto y progresivamente
>> ezplot3('', '', '',*a b+);

Dibuja la curva en

f (t ) ( f1 (t ) ; f 2 (t ); f3 (t ))

en

el

intervalo a ; b
>> ezplot3('', '', '',*a b+, 'animate');

Dibuja la curva en

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

Graficar

las

siguientes

funciones

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

vectoriales

de

la

forma

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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. Ricardo Gutirrez Tirado


EJEMPLOS:

Graficar

las

FIEE - UNAC
siguientes

funciones

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

vectoriales

de

la

forma

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

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

8],

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

27

Prof. Ricardo Gutirrez Tirado

FIEE - UNAC

B) Grfico de Funciones en Coordenadas Polares


SINTAXIS
>> t=a:s:b;
>> r=..;

(Se escribe el dominio de la funcin)


(Se escribe la funcin " y " en Matlab)

>> polar (t,r);


>> grid

(Comando para graficar en coordenadas polares)


(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. Ricardo Gutirrez Tirado

FIEE - UNAC

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

You might also like