How to get more decimal places in my output?
Ältere Kommentare anzeigen
.png)
I am using the above line in my code, but the output neglects the second term inside the bracket (the term multiplied with 'elevation'). I want to include that too. How to do so?
Akzeptierte Antwort
Weitere Antworten (3)
John D'Errico
am 6 Nov. 2019
Bearbeitet: John D'Errico
am 6 Nov. 2019
In fact, it does NOT neglect that term. It is in there, just too small for you to see in only 4 decimal places.
help format
You need to learn how to change the display format in MATLAB. I often use
format long g
as a good choice.
Nimesha Niranji
am 3 Jul. 2021
you can enter the function "format" like bellow.
>> x = pi;
>> format long
>> x
x =
3.141592653589793
>> format short
>> x
x =
3.1416
>> format bank
>> x
x =
3.14
ramdheeraj
am 9 Apr. 2023
0 Stimmen
Try displaying more decimal places of the variable x using:
format long
x
You can switch back to the default display using:
format short
x
Kategorien
Mehr zu Creating and Concatenating Matrices 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!