display result

2 visualizaciones (últimos 30 días)
trung trinh
trung trinh el 23 de Feb. de 2012
some my results displays a form fraction. For example 5118141611252665/8796093022208 but i want it display in form 581.8653 How to do that? Help me. Tk a lot

Respuestas (2)

nanren888
nanren888 el 23 de Feb. de 2012
Need a little more info. How did you get the first answer? fprintf('%9.4f',x);?

Walter Roberson
Walter Roberson el 23 de Feb. de 2012
It sounds as if you currently have
format rat
in effect. If so, try
format short g
Another possibility, though, is that you are working with symbolic numbers. If so then use double() to convert them to double precision.

Categorías

Más información sobre Just for fun en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by