You are on page 1of 6

UNIVERSIDAD NACIONAL DE SAN AGUSTIN AREQUIPA

FACULTAD DE INGENIERIA DE PRODUCCIN Y SERVICIOS


ESCUELA PROFESIONAL DE INGENIERA ELECTRNICA

CURSO

: Teora de Control Automtico I

TEMA

: Introduccin al MatLab

ALUMNO : Dueas Guardia Vctor


CUI

: 20061345

2009

Ejercicios:
1. Implemente en Matlab la siguiente funcin, luego plotee
y=f ( x ) =
-

1
x 1
2

Definimos funcion1.m

function[y]=funcion11(x)
y=1./((x.^2)-1)

Evaluamos funcion11(x)

>> x=[-5:0.01:5];
>> [y]=funcion11(x);
>> plot(x,y)

Grfica
60

40

20

-20

-40

-60
-5

-4

-3

-2

-1

2. Implemente en Matlab la siguiente funcin, luego plotee


y=f ( x1 , x2 ) =
-

x1 + x 2 ; if x 1 >0, x 2>0
x + x 22 ; en los demas casos
2
1

Definimos funcion12.m

function[z]=funcion12(x,y)
if x>0,y>0
z=x+y
else
z=((x.^2)+(y.^2)).^(0.5)
end

Evaluamos funcion12(x)

>>[x,y]=meshgrid([-10:0.5:10]);
>>z=funcion12(x,y);
>>v=z;
>>mesh(x,y,v);
>>colormap winter
>>surf(x,y,v)

Grfica

15

10

0
10
5
0
-5
-10

-10

-5

10

3. Haga un .mfile que ayude a encontrar el mnimo de:


3

f ( x )=x 2 x5
-

Definimos funcion13.m

function[y]=funcion13(x);
y=((x.^3)-(2*x)-5)

>>
>>
>>
>>
>>

Evaluamos funcion13(x)
x=[0:0.01:2];
y=funcion13(x);
plot(x,y);
xlabel('x');
ylabel('f(x)');

Grfica
-1

-2

-3

f(x)

-4

-5

-6

-7

0.2

0.4

0.6

0.8

1
x

1.2

1.4

1.6

1.8

4. Construya un seal escaln unitario, de 0 a 50 segundos,


con step inicial en 25 s.El paso deber ser de 0.5s.Plotee el
resultado.
>>
>>
>>
>>

t=0:0.5:50;
u(51:101)=1;
plot(t,u);
axis([0 50 -0.5 1.5]);

Grfica
1.5

0.5

-0.5

10

15

20

25

30

35

40

45

50

5. Construya una seal peine de dirac. Plotee el resultado.


>> peinedirac=ones(1,7); n = -3:3;
>> plot(n,peinedirac)
>> stem(n,peinedirac)

1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-3

-2

-1

You might also like