MATLAB Answers


i need an if condition that analyzes data from a for loop

Asked by Omar Almahallawy on 23 Apr 2019
Latest activity Commented on by Omar Almahallawy on 23 Apr 2019
how can i express an if condition inside a for loop that expells numbers that are greater than a static number let's say 50
so i do not want to the resluts that are more than 50 to show up in my results


Sign in to comment.

1 Answer

Answer by Walter Roberson
on 23 Apr 2019

The easiest way is to filter after you have stored everything:
YourVariable(YourVariable>50) = [];

  1 Comment

unfortunatly when i use this code, i end up with [ ] with the numbers that don't satisfy the condition

Sign in to comment.