Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How can I use dimensions in calculations i.e. 0.250(m/s^2) * 900(kg) =

1 vue (au cours des 30 derniers jours)
Ed Freyenhagen
Ed Freyenhagen le 2 Mai 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
I'm a Mathcad user and have found this very helpful, now I'm trying to learn and use Matlab - thank you.

Réponses (2)

John D'Errico
John D'Errico le 2 Mai 2016
Modifié(e) : John D'Errico le 2 Mai 2016
MATLAB is not really designed to carry units with variables. (Dimensions, if you want to call it that. I'd suggests units is a better word here, because dimension also carries a different meaning with respect to arrays. Of course, the word units also carries various connotations. Oh well.)
Yes, you can do what you want, with things like the symbolic toolbox. Or I do recall seeing a toolbox designed specifically for units purposes. To be honest, they will just make your code slower, MUCH, MUCH, MUCH slower. At some point in time, that would be important to you.
In the end, I'll argue you will come out ahead in MATLAB by learning to write code that does not rely on the crutch of units. I know that it is nice at first.

Tsvetan Donov
Tsvetan Donov le 27 Mai 2016
From what I have found out (I haven't used Matlab for very long) is that there is no straightforward way of inputing units. The simplest method is just to mention with a test line % the units for each variable.

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by