TA的每日心情 | 开心 2019-11-20 15:05 |
|---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec03
- d* J" G, v2 r, ~
5 D3 g3 a4 Z% n7 ^! j! q• How long did it take?, S1 p5 ?, w- g: d* ?! q, ]6 ^- Z
• Using min with matrices:
/ ?* A6 |6 e) F& O» a=[3 7 5;1 9 10; 30 -1 2];
2 _! J/ a' s1 v# X» b=min(a); % returns the min of each column# D, I- d. U8 v% h' P, y
» m=min(b); % returns min of entire a matrix/ m5 E5 Q' T0 _7 x5 ^; z
» m=min(min(a)); % same as above
; I: V! }8 z* H: q+ t» m=min(a( : )); % makes a a vector, then gets min, U. O- Q G5 m5 S+ G- H
• Common mistake:! ?% b$ E4 z, [- p3 g% q0 v' _
» [m,n]=find(min(a)); % think about what happens
- b5 _, |1 S/ J/ n2 \• 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
& q) c$ M/ d: J( Z* s
' ~5 m. E) G6 e, X5 F: s% e/ p" u1 J( i
" q/ o3 {1 w3 {: W; Z
|
|