MATLAB: Can someone help me with the if statements in the function

functionshomework

I have written this function for a homework assignment, Basically finding heronian isosceles triangles for a given Perimeter. My if statements
if ((b>= 2*a)) && ((b<=0));
continue
end
if IntTestA == 0
a=0; b=0; A=0;
continue
end
are not working properly I was wondering if someone could explain to me why.

Best Answer

I quickly see three issues:
  1. a is always positive so b can never be both positive (>=2*a) and negative (<= 0).
  2. for A = sqrt(...) is a loop over a single value
  3. setting the iterator in a loop (a=0) does not effect the loop. See this example
for k=1:5
disp(k)
k = 5 ;
disp(k)
end