I found the solution, BTW thank you so much @paul and @ jos(10584)
function[]=direction(bearing)
if (bearing == 0 || bearing==360)
disp('North\n')
elseif (bearing== 90 || bearing ==-270)
disp('East\n')
elseif (bearing== 180 || bearing== -180)
disp('South\n')
elseif (bearing== 270 || bearing== -90)
disp('West\n')
else
disp('Unknown Direction\n')
end
%it works fine