MATLAB: Function is not working

function

Can somebody please tell me why this is not working? I'm a beginner with Matlab
relor = gdif(target==2);
if relor > 90
coror = relor - 180;
elseif relor < -90
coror = relor + 180;
else
coror = relor;
end

Best Answer

  • coror = relor + (relor - 180).*(relor > 90) + (relor + 180) .* (relor < -90);