how to manage Fraction format problem
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear all, I have vector with numbers and fraction. How can I reduce fraction number.?for example a=[1.23456789 6.14521456 7.906342678 10.47609352]
expect results should be: re=[ 1.2 6.1 7.9 10.4] Thanks...
0 commentaires
Réponse acceptée
the cyclist
le 30 Jan 2017
Modifié(e) : the cyclist
le 30 Jan 2017
One way to display a decimal number to one decimal place:
sprintf('%5.1f',a)
Note that this will not change the value stored in a; it will only display it differently.
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!