Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Can someone help me convert this if-else statement to a switch statement? Its a homework problem that requires us to answer whether it would be quicker to write it as a switch or as an if-else statement. Im most confused by the for loop at the top.
1 回表示 (過去 30 日間)
古いコメントを表示
for i = 1:2000
for j = 1:6
if j == 1
result = 20;
elseif j == 2
result = 30;
elseif j == 3
result = 40;
elseif j == 4
result = 50;
elseif j==5
result = 60;
else result = 0;
end
end
end
0 件のコメント
回答 (0 件)
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!