MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Tae Yeong Kim
on 17 Feb 2013

I am trying to figure out the standard units of Matlab, for instance if I code mass=10, would the Matlab incorporate this as 10 kilgograms or grams?

Also, how would you put gravity into Matlab.

The only way to convert units that I figured out was to download the master m.files from the web and use it. However, is there another way such that I do not need other extra files?

*No products are associated with this question.*

Answer by Jan Simon
on 17 Feb 2013

Accepted answer

It is a general feature of numerical software **not** to assume any specific units. For the computing it does not matter, if you add seconds, meters or dollars. This has the enormous advantage, that e.g. the same optimization routine can be applied to different fields as energy consumption of an engine or predator/prey systems in biology.

Answer by Walter Roberson
on 17 Feb 2013

MATLAB has no inherent notion of units (other approximations for screen displays). Whether 10 would be kilograms or grams or pounds or slugs would depend entirely on the program.

I think there are some contributions in the File Exchange for dealing with units.

## 3 Comments

## José-Luis (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/63814#comment_130222

What is your purpose? Unit conversion?

## Tae Yeong Kim (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/63814#comment_130223

yup, I am trying to convert my units, not using mfiles from other sources.

## Jan Simon (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/63814#comment_130295

What are "the master m.files"?