TA的每日心情 | 开心 2019-11-20 15:05 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec03) X( p" y( F( O
8 |/ L6 Z- O( \( M. p/ j" a' }) M
• How long did it take?( N* _; |! N, b/ _
• Using min with matrices:
1 l" ^# O& b( ~8 I» a=[3 7 5;1 9 10; 30 -1 2];3 i6 w) O/ s4 Z+ J2 y) n# d3 z# f+ V
» b=min(a); % returns the min of each column
G- i3 U/ [2 k» m=min(b); % returns min of entire a matrix5 L9 {) x3 c* \$ _
» m=min(min(a)); % same as above2 K( e2 n/ j$ S3 f4 W
» m=min(a( : )); % makes a a vector, then gets min; l1 k3 k1 q: m, w4 |
• Common mistake:
5 J- z; P; t# A, ], Z/ Z9 [» [m,n]=find(min(a)); % think about what happens- ~. o( A) u6 `; i
• 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
/ X5 u' b% y0 M$ W% h }* ?: K s0 C- X, H: @3 d6 I
% L* I3 ^" ?$ ]! V2 h4 ?" x6 |: Q
+ h- C+ `. M1 k( ]! L0 t
|
|