MATLAB Answers


gradient image of multi -spectral image

Asked by preet
on 29 Aug 2013

when i tried this code for color gradient in RGB ,i faced a problem.

atan() function gives us range from(-pi,pi).



and to convert (0,360) degree i do


but this does not give me satisfactory result.

i want a angle matrix mean 'teta' has value (0,360) degree

  1 Comment

Amith Kamath
on 29 Aug 2013

Have you tried contacting the author of this code?



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 29 Aug 2013

Have you considered using atan2() ?


on 1 Sep 2013

i m using atan()

Walter Roberson
on 1 Sep 2013

I am aware of that. But if the information is available then atan2() is more appropriate.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!