How to make this a real number

3 vues (au cours des 30 derniers jours)
kyin gab
kyin gab le 30 Nov 2012
Commenté : Hasan le 20 Déc 2022
Hello,
My MatLab code outputs this 1.3357e+03 and I think this can be converted to a number like 1335.7.
I would like the MatLab function that will help me convert it.
Thanks for your help.
  1 commentaire
Hasan
Hasan le 20 Déc 2022
vpa(ans)

Connectez-vous pour commenter.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 30 Nov 2012
x=1.3357e+03;
out=sprintf('%.1f',x)
  1 commentaire
kyin gab
kyin gab le 30 Nov 2012
Azzi, Matt, Walter Jurgen, thanks guys

Connectez-vous pour commenter.

Plus de réponses (2)

Jurgen
Jurgen le 30 Nov 2012
sprintf?

Walter Roberson
Walter Roberson le 30 Nov 2012
  1 commentaire
Matt Fig
Matt Fig le 30 Nov 2012
Even
format short g
gets it.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by