TA的每日心情 | 开心 2019-11-20 15:05 |
|---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec03* \# F; `4 D- G" w. G N' i
7 E% T; B* l$ d& |% k& m2 i p
• How long did it take?3 S2 K1 s& z5 P
• Using min with matrices:3 D+ d1 j& `1 |% A. F1 k& ]7 F
» a=[3 7 5;1 9 10; 30 -1 2];
- ^) x' c" H! d, k# d» b=min(a); % returns the min of each column
. H4 t5 `, n( c! x* K» m=min(b); % returns min of entire a matrix
( o! m8 V. E3 D6 S» m=min(min(a)); % same as above5 K/ k+ h0 e7 O: U2 c& S; p
» m=min(a( : )); % makes a a vector, then gets min
+ D* F1 j* Y9 f! X( W• Common mistake:# M3 v( g. L3 F& G" \
» [m,n]=find(min(a)); % think about what happens E& d: g; G8 H- ~8 h8 `
• 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( D, B; J; N+ _' a( O) A" x. n1 b
* n: R' z2 V( @: F$ S7 I; D; ]. G2 U: A$ z y/ O8 }* B, V
7 o$ I( S4 _/ x
|
|