Computing

MATLAB - Radians to Degrees

Last updated: Aug. 5, 2007, 8:14 p.m.

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.)

Source Code

function d = r2d(r)
%r2d version 0.1.0
%A simple conversion function
%Radians to Degrees
%Syntax: {angle in degrees}=r2d({angle in radians})
%Author: Nathan Dumont, October 2005

d=r/pi*180;
AttachmentLast UpdateSize
r2d.mOct. 28, 2014, 10:31 p.m.190 bytes
Section:
Computing
Tags:
 

Comments

Posting comments is not currently possible. If you want to discuss this article you can reach me on twitter or via email.