TA的每日心情 | 开心 2019-11-20 15:05 |
|---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec03: y$ F% @0 ~, N' U
2 j% O& Y; |; a2 Q
• How long did it take?( B# H, I6 E& l! _4 S+ M' |1 ]
• Using min with matrices:7 G, n) S# P& [3 L
» a=[3 7 5;1 9 10; 30 -1 2];" I! Q$ C, O: }( F% L" d
» b=min(a); % returns the min of each column
S; E8 h2 e" }- k; I» m=min(b); % returns min of entire a matrix4 q2 v- o+ V/ z
» m=min(min(a)); % same as above/ E; n, u+ {. u# I
» m=min(a( : )); % makes a a vector, then gets min
2 \" b/ v; t" I/ Y- x9 Z• Common mistake:1 d( J3 f1 n. V+ ? j3 F
» [m,n]=find(min(a)); % think about what happens
* h2 s# {8 y4 v6 n; B• 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 way5 e) d! V3 f* Y- l+ Z9 f
6 T0 _' r: O* @" W5 L- w
! e' J5 f7 |5 z- o: I! N
; [$ s* m+ t# `1 B4 h% H6 B0 Q |
|