How can I reduce the number of digits after the decimal point?
29 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Milad Zarei
el 13 de Feb. de 2017
Comentada: Neetesh Kumar Sharma
el 15 de Sept. de 2022
Matlab shows a number with 2 digits after the decimal point (e.g. 0.8100) in the Command Window, but when you open the variable it is 0.810000000000000. Do you know how I can cut those zeros off?
I do not want to show them in the Command Window (print, fprint or anything like that). I want to see just 2 digits after the decimal point when I open the variable in the Variables section.
Also, I have tried round(x*1000)/1000 and Format (short and bank), and they do not do what I want to!
I saw that someone else had the same problem a while ago ( here) but no one knew the correct answer!
Thanks.
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MuPAD en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!