私は問題の matlab コードを書いており、switch ケースを使用して一連の数字をチェックしています。スイッチケースを使用することは、割り当ての要件です。
switch score
case {90,91,92,93,94,95,96,97,98,99,100}
disp('Your grade is an A');
case {80,81,82,83,84,85,86,87,88,89}
disp('Your grade is an B');
case {70,71,72,73,74,75,76,77,78,79}
disp('Your grade is an C');
case {60,61,62,63,64,65,66,67,68,69}
disp('Your grade is an D');
otherwise
disp('Your grade is an F');
end
などのように範囲を入力しやすくする方法はありますscore < 60
か?
この元の方法が唯一の方法である場合、小数をチェックする方法は?