|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
最简单的逻辑命令是if, ..., end,其基本形式为: , m* n0 K& D# c) D; `
" h8 N+ N( L/ v; jif 条件式;
6 P1 i& p; Z( a$ \. o y+ G; a9 }) i" V; |0 u% j. [4 }/ M* X
运算式; , k. t0 ?8 w* N$ g
: \$ c% I* M2 R% |" Mend 6 s9 D8 b+ f9 _3 ~; e! s6 ~
8 h! [! I1 M7 q* b
if rand(1,1) > 0.5, - ]0 t s1 D6 S
8 w/ [) n% _" x- n9 d
disp('Given random number is greater than 0.5.');
4 @' r6 f$ s( { E
9 h! p+ h& J* r7 uend
6 D+ _: H9 D7 `' P
9 ]4 u% V# K3 |Given random number is greater than 0.5. |
|