How to get rid of the zero decimal?

One of my Matlab assignment answers are like:
1.0000 76.0000 23.0000 8.0000 68.0000 24.0000
But I want it to be like
1 76 23 8 68 24
How can I fix this?

Respuestas (3)

Babak
Babak el 10 de Sept. de 2012
Type
format short
in the command window
Star Strider
Star Strider el 10 de Sept. de 2012
Editada: Star Strider el 10 de Sept. de 2012

0 votos

If you are talking about the Command Window output, see format. If you always want a particular output format, you can change it in preferences. Otherwise, see fprintf for print format specifiers.
Walter Roberson
Walter Roberson el 10 de Sept. de 2012

0 votos

round() the output: it is currently not exact integers.

Categorías

Etiquetas

Preguntada:

el 10 de Sept. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by