MATLAB: For Loop with two constraints

for loop

Hi everyone, I have a really simple question.
How can I write a 'For' loop with two constraints :
  1. y1>f(y2) – function f is known
  2. y2= a:b
I write that :
for y2=a:b
for y1>f(y2) - it does not seem to work
P=X
end
end
Thanks,

Best Answer

for y2=a:b
if y1>f(y2)
%do whatever
end
end