Missing factor using rule of three?

3 Ansichten (letzte 30 Tage)
Pawl
Pawl am 13 Mär. 2019
Kommentiert: Pawl am 13 Mär. 2019
Hello,
I try to calculate a distance in meter, given the rad values. I use the follwing formula, which is really easy.
0.004 x (m)
--------- = ----------
2*pi y (rad)
If I want to know which x(m) corresponds to 4*pi the formula becomes
(0.004*4*pi)/(2*pi)=2*0.004=0.008
This is a result I would expect, but putting the same formula into matlab or any calculator results in
(0.004*4*pi)/2*pi
ans=
0.078956
Next to a missing magnitude it is not 100% correct as well. I think one reason is limited digits of pi, but why is a magnitude missing?
I am sorry for such a trivia question, but maybe someone could give me a hint. I propably think in a wrong direction.

Akzeptierte Antwort

the cyclist
the cyclist am 13 Mär. 2019
Bearbeitet: the cyclist am 13 Mär. 2019
Try
(0.004*4*pi)/(2*pi)
The reason your syntax does not work is that it will divide by 2, and then multiply by pi.
See order of operations for details on how expressions are evaluated.
  1 Kommentar
Pawl
Pawl am 13 Mär. 2019
Thank you so much, I really struggeld for some days.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by