Let me make a suggestion for @mgoodwin : while MS units are very useful, I only use them rarely. Instead I have a script setUpUnits that returns a structure, which I set to un . The script setUpUnits has two arguments, the first defines the basic system of units I wish to define as the default. So if I want to work with mks, I set the first argument to "mks". If I want to use feet/lbm, I set the argument to "feet". The second is for deg vs rad.
So for mks & deg I have:
un = setUpUnits("mks", "deg")
The un structure will then contain a list of values that will covert a given unit to that of my default base system. In the above case, un.m will contain 1 and un.ft will contain 0.3048.
If I have data in meters, say 5 meters, i write:
data = 5*(un.m)
If I have some other data, say 6 feet, I write:
other = 6*(un.ft)
And the above will be converted to feet. If I wanted the original data (5m) to be shown in feet, I write:
And that will show me the value of data converted to feet.
A second benefit is that I can switch the base unit system if need be, and then i can work in the new system. Nothing needs to be updated, expect the call to setUpUnits to select the base system.
Below are some snippets of screen shots:
Naturally I can add any units or constants I find useful. And I can add any names. I have this same routine in a number of applications, such as matlab/octave, so I can often just copy and paste lines wholesale as I need them.