TA的每日心情 | 开心 2019-11-20 15:05 |
|---|
签到天数: 2 天 [LV.1]初来乍到
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
MIT6_094IAP10_lec02/ [ t. x- L3 X4 \
+ F- Y6 U. h+ }1 T7 A
• How long did it take to do required problems?0 _1 H% y$ l4 E* O. I, H5 C
• Did anyone do optional problems?
* C x+ }) [/ a. w• Was level of guidance appropriate?& y$ x- M7 |. |; U* {! H3 g! o! Z
• Unanswered Questions?
- N. z# j' G( s6 R2 D$ L/ v• Some things that came up:5 X+ D0 F! e/ T0 M8 i& K% i$ Q$ y
• Use of semicolon – never required if one command per line. $ k6 N0 u9 |) m( _* p, I. {1 x0 g
You can also put multiple commands on one line; in this case a semicolon is necessary to separate commands:! S$ `4 [% F) @# w
» x=1:10; y=(x-5).^2; plot(x,y);: U) l; t& L [& w: A) r
• Assignment using indices – remember that you can index into matrices to either look up values or to assign value:* y7 O& ]/ K( Q$ h% ^; f1 c+ N
» x=rand(50,1); inds=find(x<0.1); y=x(inds); % z5 E' J- z+ p- _
x(inds)=-x(inds); x(inds)=3;
" ^! j" j( B& F1 M% I
$ {6 r9 L, n2 j* t7 b3 v
5 j. f/ s/ J# l3 n6 D. K7 B7 w* _. q# w& R* m1 T# m
|
|