フィルターのクリア

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 日間)
Pablo Garcia
Pablo Garcia 2018 年 11 月 4 日
閉鎖済み: John D'Errico 2018 年 11 月 4 日
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 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by