if,switch,for语句用法
%if else
a=2
if a==1
b=0
else
b=1
end
%switch-case
switch a
case 1
c=0
otherwise
c=1
end
%for循环
d=0
for i=1:3
d=d+1
if d==2
e=1
return
end
end
Matlab编程
阅读 46
2022-02-01
if,switch,for语句用法
%if else
a=2
if a==1
b=0
else
b=1
end
%switch-case
switch a
case 1
c=0
otherwise
c=1
end
%for循环
d=0
for i=1:3
d=d+1
if d==2
e=1
return
end
end
相关推荐
精彩评论(0)