0% found this document useful (0 votes)
8 views

Function: 'Ingresa Vector X ' 'Función y F (X) '

1) The document defines a function that takes in a vector x, calculates y as the inverse of x squared minus 1, and plots the function. It then generates a sample x vector and calls the function to generate the corresponding y values. 2) It defines a step function that takes in time t and breakpoint T, plots the step function, and labels the axes and title. 3) It generates an array of ones representing an impulse train, plots it with the x values as the stem locations and labels the plot.

Uploaded by

Omar Almonte
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Function: 'Ingresa Vector X ' 'Función y F (X) '

1) The document defines a function that takes in a vector x, calculates y as the inverse of x squared minus 1, and plots the function. It then generates a sample x vector and calls the function to generate the corresponding y values. 2) It defines a step function that takes in time t and breakpoint T, plots the step function, and labels the axes and title. 3) It generates an array of ones representing an impulse train, plots it with the x values as the stem locations and labels the plot.

Uploaded by

Omar Almonte
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1)

M.FILE
function y=funcin(x)
x=input('Ingresa vector x=');
y=(x.^2-1).^(-1);
plot(y,x),grid,title('funcin y=f(x)');

x=-5:0.5:5
x=
Columns 1 through 8
-5.0000 -4.5000 -4.0000 -3.5000 -3.0000 -2.5000 -2.0000 -1.5000
Columns 9 through 16
-1.0000 -0.5000

0.5000

1.0000

1.5000

2.0000

2.5000

Columns 17 through 21
3.0000

3.5000

4.0000

4.5000

5.0000

0.0355

0.0384

0.0417

0.0454

0.0496

0.0744

0.0836

0.0947

0.1082

0.1250

0.2604

0.3333

0.4464

0.6410

1.0417

>> funcion(x)
Ingresa vector x=-6:0.2:6
ans =
Columns 1 through 8
0.0286

0.0306

0.0329

Columns 9 through 16
0.0545

0.0601

0.0667

Columns 17 through 24
0.1462

0.1736

0.2101

Columns 25 through 32
2.2727

Inf -2.7778 -1.5625 -1.1905 -1.0417 -1.0000 -1.0417

Columns 33 through 40
-1.1905 -1.5625 -2.7778

Inf

2.2727

1.0417

0.6410

0.4464

Columns 41 through 48
0.3333

0.2604

0.2101

0.1736

0.1462

0.1250

0.1082

0.0947

0.0601

0.0545

0.0496

0.0454

0.0417

Columns 49 through 56
0.0836

0.0744

0.0667

Columns 57 through 61
0.0384

0.0355

0.0329

0.0306

0.0286

4)

t=input('ingresar su intervalo t=');


T=input('ingrese su punto de quiebre T=');
y=stepfun(t,T);
plot(t,y)
xlabel('t');ylabel('x(t)')
title('escalon unitario')
axis([0 50 0 2])

escalon unitario
2
1.8
1.6
1.4

x(t)

1.2
1
0.8
0.6
0.4
0.2
0

10

15

20

25
t

30

35

40

escalon=ones(1,10);
escalon=ones(1,11);
x=input('ingrese su intervalo de x=');
stem(x,escalon)
xlabel('x');ylabel('?');title('PEINE DE DIRAC')
axis([-3 3 0 1.5])

PEINE DE DIRAC
1.5

0.5

0
-3

-2

-1

0
x

45

50

You might also like