MATLAB: Illegal use of reserved keyword “if”

if statement

Best Answer

You can't do this:
else data.Bladder(i) == 0
You can have this:
elseif data.Bladder(i) == 0
or this:
else
data.Bladder(i) = 0
but not plain "else" followed by a condition. Use whichever you want to do (since I'm not sure what you're intending), though I imagine it's probably
elseif data.Bladder(i) == 0