TA的每日心情 | 开心 2019-11-20 15:05 |
|---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec02
" t$ `+ {. O. R5 b! |9 q
T X* H3 f, S# U" {8 B7 K; E! [7 c• How long did it take to do required problems?
1 L, t3 Y. d0 A, E0 b• Did anyone do optional problems?9 ~9 ^4 \% V/ l+ D
• Was level of guidance appropriate?
# n1 C; u6 \/ v9 F7 x• Unanswered Questions?
" k. r- C( x3 y0 ?2 P. C1 a" o* J• Some things that came up:
9 C; Z+ G0 v' Y0 `) V• Use of semicolon – never required if one command per line. & `- f! [. P# t4 H& f) }' q# H8 o/ y
You can also put multiple commands on one line; in this case a semicolon is necessary to separate commands:
r/ T! S) i6 ~» x=1:10; y=(x-5).^2; plot(x,y);
! M4 _. X0 z2 A1 N3 r• Assignment using indices – remember that you can index into matrices to either look up values or to assign value:' k) x' J- p+ b, R) Y' `+ s
» x=rand(50,1); inds=find(x<0.1); y=x(inds); / F8 m" E; ?2 g) z) ]
x(inds)=-x(inds); x(inds)=3;
. @0 c0 j% ~, w; N2 D
. I6 f1 N7 S4 l& L) T8 j' G
) `: ^/ J5 @$ G; D# X
0 s, C) U$ f( {2 f, E0 b |
|