MATLAB - Radians to Degrees
Last updated: 05 Aug 2007 - 20:14
Written at the same time as the degrees to radians function as a compliment to it. Again, the function is incredibly simple, however, it's a handy thing to have in your path anyway. It's also a really simple function, showing the syntax to create a function that takes an argument, returns a value, and has a documentation string (if I remember correctly just type help r2d into MATLAB and it should describe the function if it's in your path.)
MATLAB - Degrees to Radians
Last updated: 05 Aug 2007 - 19:03
This is one of the earliest bits of MATLAB code that I wrote. It's basically a one line function that converts an input value in degrees to radians. The code is so simple I have no doubt that all users of MATLAB would be able to write it with a few moments of thought, however, I often found it useful to have this function in my path when writing code to allow me to call it without having to think, e.g. sin(d2r(alpha)) where alpha was the angle in degrees.