TA的每日心情 | 开心 2019-11-20 15:05 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec03
8 U# ~. O3 }5 s* ?7 K8 T a; i8 P# k
• How long did it take?. d# ^, A4 W. D) |0 _$ S
• Using min with matrices:
! u% j6 b* ~+ m, P d/ S. P» a=[3 7 5;1 9 10; 30 -1 2];
5 C, x0 c T: ?. G. N» b=min(a); % returns the min of each column4 b7 {. s: A* S# k& A& @
» m=min(b); % returns min of entire a matrix: d" W4 @6 ]0 {- o; X
» m=min(min(a)); % same as above
1 x0 {1 X. O% r' E6 |/ v» m=min(a( : )); % makes a a vector, then gets min6 I/ W) @- ^: a4 X' O; v
• Common mistake:( N6 f5 n4 z8 Q; O
» [m,n]=find(min(a)); % think about what happens7 H# |0 f @9 N1 E! d
• How to make and run a function: save the file, then call it from the command window like any other function. No need to 'compile' or make it official in any other way
4 ?4 H' T: ^( l. z
3 e- x& p% P+ k, O9 m% d, h+ }
9 }" H. n% O9 [# H7 _3 c5 ^4 [3 m! \6 L2 P2 X" a: J, `( _7 g
|
|