Académique Documents
Professionnel Documents
Culture Documents
Curso:
LABORATORIO DE CONTROL 1
LABORATORIO N 3
2013
FUNCIONES MATEMATICAS ELEMENTALES
>> x=-pi:0.01:pi;
Ejemplo
sin(pi/6)
ans =
0.5000=1/2
>> x=-pi:0.01:pi;
Ejemplo :
>> cos(pi/6)
ans =
0.8660=3^(1/2)/2
x = (-pi/2)+0.01:0.01:(pi/2)-0.01;
plot(x,tan(x)), grid on
ejemplo:
>> tan(pi/6)
ans =
0.5774
Dominio=[-1,1] rango=[-pi/2,pi/2]
x = -1:.01:1;
plot(x,asin(x)), grid on
ejemplo:
>> asin(pi/6)
ans =
0.5511
Dominio=[-1,1] rango=[0,pi]
x = -1:.05:1;
plot(x,acos(x)), grid on
ejemplo:
>> acos(pi/6)
ans =
1.0197
Arcotan(x): devuelve un angulo entre (pi/2 y pi/2)
Dominio=R rango=[pi/2,-pi/2]
Ejemplo:
x = -20:0.01:20;
plot(x,atan(x)), grid on
>> atan(pi/6)
ans =
Dominio =R rango=R
Ejemplo:
x = -5:0.01:5;
plot(x,sinh(x)), grid on
Ejemplo:
x = 1:pi/40:pi;
plot(x,cosh(x)), grid on
Dominio =R rango=-1,1
Ejemplo:
x = -5:0.01:5;
plot(x,tanh(x)), grid on
ejemplo:
x = -5:.01:5;
plot(x,asinh(x)), grid on
ejemplo:
>> sqrt(64)
ans =
8
Round(x): redondea a el entero mas prximo
Ejemplo:
>> round(12.3)
ans =
12
x=[0:1:10]
x=
0 1 2 3 4 5 6 7 8 9 10
log(x)
ans =
Columns 1 through 8
Columns 9 through 11
2.0794 2.1972 2.3026
log10(x)
ans =
Columns 1 through 8
Columns 9 through 11
exp(x)
ans =
1.0e+004 *
Columns 1 through 8
Columns 9 through 11
ans =
Columns 1 through 8
Columns 9 through 11
clear
x=[-5:1:5]
x=
-5 -4 -3 -2 -1 0 1 2 3 4 5
sign(x)
ans =
-1 -1 -1 -1 -1 0 1 1 1 1 1
clear
clc
x=[0:1:10]
x=
0 1 2 3 4 5 6 7 8 9 10
y=2
y=
rem(x,y)
ans =
0 1 0 1 0 1 0 1 0 1 0
mod(x,y)
ans =
0 1 0 1 0 1 0 1 0 1 0
help mod
MOD Modulus after division.
then n is that integer. The inputs x and y must be real arrays of the
The statement "x and y are congruent mod m" means mod(x,m) == mod(y,m).
By convention:
MOD(x,0) is x.
MOD(x,x) is 0.
Note: REM(x,y), for x~=y and y~=0, has the same sign as x.
MOD(x,y) and REM(x,y) are equal if x and y have the same sign, but
Overloaded methods:
clear
clc
x=[1:.1:10]
x=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
Columns 25 through 32
Columns 33 through 40
Columns 41 through 48
5.0000 5.1000 5.2000 5.3000 5.4000 5.5000 5.6000 5.7000
Columns 49 through 56
Columns 57 through 64
Columns 65 through 72
Columns 73 through 80
Columns 81 through 88
Columns 89 through 91
ans =
Columns 1 through 14
1 1 1 1 1 2 2 2 2 2 2 2 2 2
Columns 15 through 28
2 3 3 3 3 3 3 3 3 3 3 4 4 4
Columns 29 through 42
4 4 4 4 4 4 4 5 5 5 5 5 5 5
Columns 43 through 56
5 5 5 6 6 6 6 6 6 6 6 6 6 7
Columns 57 through 70
7 7 7 7 7 7 7 7 7 8 8 8 8 8
Columns 71 through 84
8 8 8 8 8 9 9 9 9 9 9 9 9 9
Columns 85 through 91
9 10 10 10 10 10 10
fix(x)
ans =
Columns 1 through 14
1 1 1 1 1 1 1 1 1 1 2 2 2 2
Columns 15 through 28
2 2 2 2 2 2 3 3 3 3 3 3 3 3
Columns 29 through 42
3 3 4 4 4 4 4 4 4 4 4 4 5 5
Columns 43 through 56
5 5 5 5 5 5 5 5 6 6 6 6 6 6
Columns 57 through 70
6 6 6 6 7 7 7 7 7 7 7 7 7 7
Columns 71 through 84
8 8 8 8 8 8 8 8 8 8 9 9 9 9
Columns 85 through 91
9 9 9 9 9 9 10
clear
clc
x=[-5:0.4:5]
x=
Columns 1 through 8
Columns 9 through 16
Columns 17 through 24
4.6000 5.0000
floor(x)
ans =
Columns 1 through 14
-5 -5 -5 -4 -4 -3 -3 -3 -2 -2 -1 -1 -1 0
Columns 15 through 26
0 1 1 1 2 2 3 3 3 4 4 5
diary off
ceil(x)
ans =
Columns 1 through 14
-5 -4 -4 -3 -3 -3 -2 -2 -1 -1 -1 0 0 1
Columns 15 through 26
1 1 2 2 3 3 3 4 4 5 5 5
clear
clc
[g,c,d] = gcd(30,56)
g=
c = -13
d=
diary off
uiopen('C:\Users\jorge\tarea_GutierrezGamio',1)
[g,c,d] = gcd(20,30)
g=
10
c=
-1
d=
lcm(24,40)
ans =
120
real(12+4i)
ans =
12
imag(12+4i)
ans =
abs(12+4i)
ans =
12.6491
doc angle
clc
clear
Z=
1.0000 - 1.0000i 2.0000 + 1.0000i 3.0000 - 1.0000i
doc angle
angle(Z)
ans =