File Exchange

image thumbnail

degrees and radians

version (1.55 KB) by Richard Medlock
Two helper functions, one converts degrees to radians, the other rads to deg.

1 Download

Updated 18 Aug 2009

View Version History

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

Two simple functions to save time writing out the code to do a degrees to radians calculation or vice versa.

Cite As

Richard Medlock (2021). degrees and radians (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

Afzal khan

Is anyone know how control mac os applications. a webpage suggests but neede explanation. the page is here

Afzal khan

Exactly looking match found on and Thanks both webpages.

Abel Luis

meu, você é o cara

Nathan Birch

Exactly what I was looking for, thank you.


Makes computation time longer. Very simple. Yet very useful at times.

Jeff Gibson

Good simple function. Any true programmer understands the importance of maintainability and code reuse from a software engineering perspective, espcially when the performance hit is infinitesimal.

Richard Medlock

Duane - yes you are probably correct, the original calculation however was done differently and was shorter. However, the benefit for me personally is two fold - 1) it makes it easier to troubleshoot the code because it's more readable and 2) repetitive calculations are generally best kept as functions which enable you to more easily find and replace them, and avoid mistakes in typing out duplicate code. But everyone has their own preferred way of doing things.

Duane Hanselman

How does this save time? Function calling overhead makes this computationally slower than direct multiplication. Typing the function call degrees(theta) is 14 keystrokes whereas 180/pi*theta is only 12 keystrokes. The same is true for typing radians(theta). So how does this save time?



Carson Smith


Atul Kumar

padmanaban RPS

good yar

Seung-Bin Lim

ezekiel calderon

if only i knew earlier how to install the file, i would be a lot easier.

a a

thank you so much. you helped me out a whole lot.

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: deg2rad and rad2deg conversion functions

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!