Vous êtes sur la page 1sur 10

1

%-- 04/04/2013 02:43 p.m. --%

edit

9/7

a=3/7

3/7=a

a=3/7

pi

format long

pi

whos

format short

pi

sin(pi/3)

sin(pi/6)

sind(60)

% d --> degrees --> grados

sind(30)

cos(pi/6)
2

cosd(30)

format long

format short

whos

pi

format short

tan(pi/6)

tand(30)

format compact

cot(pi/6)

cotd(30)

sec(pi/6)

secd(30)

csc(pi/6)

cscd(30)

asin(0.5)

asind(0.5)

sinh(2)
3

asinh(3.6269)

log(10)

exp(2.3026)

format long

log(10)

exp(2.302585092994046)

1/3

whos

log10(1000)

10^3

8.5^1.2

% sqrt --> square root -> raíz cuadrada

sqrt(81)

729^1/3

729^(1/3)

format short

729^(1/3)

% MATLAB --> MATRIX LABORATORY


4

x = [1 2 3 4 5 6 7 8 9 10]

x = 1:1:10

x = 1:10

y = [2 4 6 7 12 23 45 65 78 98]

plot(x,y)

a = 3:7:45

a = 3:7:46

45:-7:3

a = 45:-7:3

a=0:0.2:2

b = linspace(1,100,8

b = linspace(1,100,8)

b = linspace(1,100,5)

z = exp(x)

4E-1.3

4E-13
5

format long

z = exp(x)

format short

z = exp(x)

plot3(x,y,z)

grid on

title('Gráfico x-y-z')

xlabel('x')

ylabel('y')

zlabel('z')

plot3(x,y,z,'o')

grid on

plot3(x,y,z,'*')

plot3(x,y,z,'>')

plot3(x,y,z,'<')
6

plot3(x,y,z,'^')

plot3(x,y,z,'r^')

plot3(x,y,z,'g^')

plot3(x,y,z,'k^')

plot3(x,y,z,'y^')

plot3(x,y,z,'m^')

plot3(x,y,z,'c^')

plot3(x,y,z,'ro:')

plot3(x,y,z,'ro-.')

plot3(x,y,z,'ro-')

plot3(x,y,z,'ro--')

plot3(x,y,z,'ro--.')

figure

plot(x,y,'o-')

hold on

plot(x,z,'r^--')

z=z*100;
7

plot(x,z,'r^--')

z=z*10;

figure

z=x;

plot(x,y,'o-')

plot(x,z,'r^--')

hold on

plot(x,y,'o-')

sum(x)

mean(x)

prod(x)

x = [4 2 7 4 9 1 5 2 0 3]

y = sort(x)

y = sort(x,'descend')

y = sort(x,'ascend')

median(y)
8

mode(y)

min(y)

max(y)

x = [4 2 7 4 9 1 5 2 0 3]

x*x

whos x

y=x'

whos x y

x*y

y*x

x+y

x+y'

x'+y

z=x.*x

p = z./y'
9

% NaN Not a Number


0/0
1/0
q = z.^3
x = -3:0.1:3;
y = sin(x)*cos(x)^2
y = sin(x).*cos(x).^2;
plot(x,y)
hold off
plot(x,y)
sin(0)
cos(0)
hold on
plot(x,sin(x),'r')
plot(x,cos(x),'r')
plot(x,sin(x),'r')
hold on
plot(x,cos(x),'r')
plot(x,tan(x),'r')
hold off
plot(x,cos(x),'r')
hold on
plot(x,sin(x),'r')
10

hold off
plot(x,sin(x),x,cos(x),'r')
subplot(2,2,1)
plot(x,sin(x))
subplot(2,2,2)
plot(x,cos(x),'r')
subplot(2,2,3)
plot(x,sin(x).*cos(x).^2,'m')
subplot(2,2,4)
plot(x,cos(x).*sin(x).^2,'k')

Vous aimerez peut-être aussi