Help with "if" function.
信息
此问题已关闭。 请重新打开它进行编辑或回答。
显示 更早的评论
Hello all,
I'm new to MatLab, wich I use in a computer class in my field of study. I'd like to know only a thing about the "if" function.
I want to write a programme that will calculate the value of a weight, and the error that is acceptable on the weight. Then, I want to use a if statement that will tell the user either if the weight is in the acceptable range or it isn't. Here's what I have in mind :
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
e=3
if e==[2,4] %I want the statement to be : if e is element of the following range
display('It''s ok')
elseif e==out of range
display('It''s not ok')
end
0 个评论
回答(1 个)
此问题已关闭。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!