the if statement with and/or

3 views (last 30 days)
moji
moji on 17 Jun 2014
Edited: Azzi Abdelmalek on 17 Jun 2014
Is this right?
If a and b and c and d <= 100 {statement} end
  2 Comments
Chad Greene
Chad Greene on 17 Jun 2014
Your question is not very clear. What do your data look like and what is your goal?
Geoff Hayes
Geoff Hayes on 17 Jun 2014
No, that statement is incorrect. In the Command Window, type help if or doc if for details on constructing an if statement and how relational operators are used in compound expressions.

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 17 Jun 2014
Edited: Azzi Abdelmalek on 17 Jun 2014
if a<100&b<100&c<100&d<100
%do
end
%or
if all([a b c d]<100)

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!