Loop answers slightly out from correct values
Ältere Kommentare anzeigen
So in my script, I'm using a loop/ if else function. The values this function spits me out are very close to the Pi values in section 5 of my picture, however they arn't quite the same and I can't figure out Why. As the values get smaller and smaller the difference between the values I get and the answers on the table. However, my last formula of Pr/Rs*TI gives me answers that are correct according to the table in section 5. How is this possible when my Pi (called Pr) values are not correct?

Akzeptierte Antwort
Weitere Antworten (1)
Xavier
am 9 Sep. 2020
Unfortunately I can't debug the script as I don't have the Symbolic Maths Toolbox, however I would use
format long
when debugging to trace the error. An issue arises when using floating point numbers as due to the memory allocation process, random memory which is overwritten can be read again- there is more information on this here. This may account for the small differences in your numbers
1 Kommentar
Liam Crocker
am 9 Sep. 2020
Kategorien
Mehr zu Mathematics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!