matlab : program runs differently depending on the use of cos or cosd
===

I've written a program in Matlab that when i represent angles in radians and thus call cos and sin function, works properly. But, when i represent angles in degrees and thus call cosd and sind the program doesn't work properly.

Is there any relation to cos and cosd function? How can I fix the problem? Or this "running" difference reveals a bug in my program?