Post on 28-Feb-2018
7/25/2019 Clase 6 Matlab Introduccion
1/17
!!"###
%&''()*&+,(- !.)/0,(1*.+(2&-
/('( 3+4&+*&'5( 6 !*&+1*(-
7(,'*1*. 7.82&,&
9(5'( 9(':0&-
Primavera 2015
!"#$% ' ( )*+,*-
./012345567/
7/25/2019 Clase 6 Matlab Introduccion
2/17
894: %$ )*+,*-;
!"#$%&'" &)*+,&)"#-" %.&/0 "# ,#$"#,"12& 3"# 4,"#4,& *&1& 5&4"1 46+4%+0. #%)71,40.8.,)%+&4,9#8 :,.%&+,;&4,9# /" /&-0.8 "-4 2+3
ans = 5
>> 2+1/(4*5)
ans = 2.0500
>> 2^10
ans = 1024 3
7/25/2019 Clase 6 Matlab Introduccion
4/17
?#16#="%$ @ A4/562/%$
!0. 1".%+-&/0. ." *%"/"# $%&1/&1 "# :&1,&>+".+". 3 C%#4,0#". *1"/"C,#,/&.> x=2
x = 2
>> y=sqrt(x)y = 1.4142
>> z=2*cos(pi/4)
z = 1.4142 4
7/25/2019 Clase 6 Matlab Introduccion
5/17
?%5021%$
E )"#%/0 -1&>&'&1")0. 40# +,.-&. /" #J)"10.8++&)&/&. !"#$%&"'
>> notas=[5.5 6.1 4 2 7.0 6.2 5.7]
notas =
5.5000 6.1000 4.0000 2.0000 7.0000 6.2000 5.7000
>> promedio=mean(notas)
promedio = 5.2143
>> nnotas=length(notas)
nnotas = 7
5
7/25/2019 Clase 6 Matlab Introduccion
6/17
)>$ $2=1% B%5021%$
E>1":,&-%1&. *&1& +,.-&.>> x=1:5
x = 1 2 3 4 5
>> x=0:pi/5:pi
x = 0 0.6283 1.2566 1.8850 2.5133 3.1416
K" *%"/" &*+,4&1 C%#4,0#". & :"4-01".
>> y=sin(x)
y = 0 0.5878 0.9511 0.9511 0.5878 0.0000
6
7/25/2019 Clase 6 Matlab Introduccion
7/17
C1>A652$
>> plot(x,y)
7
7/25/2019 Clase 6 Matlab Introduccion
8/17
C1>A652$
>> x=0:pi/100:pi; % ;" indica modo silencioso
>> y=sin(x);
>> plot(x,y)
8
7/25/2019 Clase 6 Matlab Introduccion
9/17
DE%156562
L1&C,4&1 .,# 3 40. .%*"1*%".-&. "#-1" M 3 NO
9
7/25/2019 Clase 6 Matlab Introduccion
10/17
DE%156562
F0)&1 %# 1"4-6#$%+0 /" 4%&+P%,"1 -&)&Q0< B#"+ +&/0 )6. +&1$08 40#.-1%,1 %# 4%&/1&/0*"$&/0 &+ 1"4-6#$%+0< F0)&1 "+ 1"4-6#$%+0
40)*+"-0 1".%+--" 3 1"*"-,10-"++&.
40#."4%-,:&.