【发布时间】:2015-12-16 16:00:42
【问题描述】:
您好,在这里使用 Matlab 进行编程,由于某种原因,我的 while 循环中不断出现错误。谁能给我一个关于如何在while循环中创建多个条件的例子?这是我的while循环,
while (user_input ~= 256);%try catch does not work very well for this
prompt = 'Please enter one of the listed gray levels (256, 128, 64, 32, 16, 8, 4, 2). ';
user_input = input(prompt);
end
我希望它是这样的,
while (user_input ~= 256 || user_input ~= 128 || user_input ~= 64)
感谢您的帮助!
【问题讨论】:
标签: matlab while-loop operators conditional