Info
This question is closed. Reopen it to edit or answer.
Help with "if" function.
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!