I will post my code that i made, im a noob. just take my "||" as or in english, thats what i think of it, but it dont work, it only gives me 'NORTH' for any value please check and correct..It is m,y university assignment.
function[r]=direction(bearing)if bearing == 0 || 360 r= 0 || 360; printf('North\n')elseif bearing== 90 || -270 r= 90 || -120; printf('East\n')elseif bearing== 180 || -180 r= 180 || -180; printf('South\n')elseif bearing== 270 || -90 r= 270 || -90; printf('West\n')else printf('Unknown Direction\n')end
Best Answer