标题: MIT6_094IAP10_lec03 [打印本页] 作者: Colbie 时间: 2020-6-16 10:34 标题: MIT6_094IAP10_lec03 MIT6_094IAP10_lec03 6 F J, E' t9 b l4 M7 M8 f6 b. r8 L5 Y) D, Q
• How long did it take?4 W$ X% ]( j' c
• Using min with matrices:- W8 S |/ z% a( u
» a=[3 7 5;1 9 10; 30 -1 2];) W" w5 a4 y* V! ]" d
» b=min(a); % returns the min of each column ! \" C ]8 d( w) N5 C" L» m=min(b); % returns min of entire a matrix: w% t* y0 m" @% [! c
» m=min(min(a)); % same as above1 `4 y7 N0 ^+ `! a" o
» m=min(a( : )); % makes a a vector, then gets min8 w& R# \! v! U2 `9 B3 W
• Common mistake: ( F6 R u. Q/ q3 T3 [2 l» [m,n]=find(min(a)); % think about what happens, `( J0 | I: b: i0 h: W+ W- P
• 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 |* \, j/ d( x1 A 8 T- d, L) Y0 g; a, n1 t+ v / a X" k) m8 q x0 L* c* X; L ( l, E7 W8 g, ~9 z5 u8 j9 W% [作者: busahuang 时间: 2020-6-16 13:20
看看什么好东东。