|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
最简单的逻辑命令是if, ..., end,其基本形式为: 9 H1 j& l' h3 v
6 C1 \7 ?) x# O4 d7 j
if 条件式;
; `$ G4 B& v7 Q( O) n5 f' U2 y
0 c8 v y5 c, V$ l7 v( `运算式;
2 b+ L+ X" f! ^: b
7 Y7 u# d/ C" L6 k" Qend : R# e/ v- `$ z4 B e0 D8 _! E
; Z5 n, f2 W/ \if rand(1,1) > 0.5,
) T! U C5 \2 D0 o! j4 H, s
& O. v6 I* B c8 e7 S, E7 ldisp('Given random number is greater than 0.5.');
) |! H3 j) M% @2 K* s) A' h# d I
end
; J4 I/ ^. S9 D+ l% ]3 g5 h* Y
) ]( Q' b# z8 ~( i2 i6 s4 RGiven random number is greater than 0.5. |
|