Using save() and -ascii format to limit output numbers to 2 decimals
94 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
adi kul
le 7 Juin 2017
Réponse apportée : Do Hieu Trinh
le 15 Avr 2021
Hello All, I need help with save() command. here is the extract of my code:
save(fullfile(PathName,filename),'x','-ascii');
Where x is a column of 120 values upto 2 decimal points.
Now what I am getting with above code is 4.7300000e+01 which I want to limit to 47.30 only. I know they are one of same but I have another script which reads only 47.30 kind of format. So even though both are same I have to restrict it to 2 decimals only.
So is there any way to do that?
0 commentaires
Réponse acceptée
Stephen23
le 7 Juin 2017
Modifié(e) : Stephen23
le 7 Juin 2017
6 commentaires
Jabbar moosavi
le 7 Fév 2020
Modifié(e) : Jabbar moosavi
le 7 Fév 2020
I've same question ,the reference data has 3 columns " x,y and pixel values" but this code save the data under "x".I want all the values in the same columns .
so how can I do that ?
Plus de réponses (1)
Do Hieu Trinh
le 15 Avr 2021
Dear Stephen,
Do you know a trick which works for saving data into .m file using matlab.io.saveVariablesToScript?
Best regards,
Do Hieu.
0 commentaires
Voir également
Catégories
En savoir plus sur Standard File Formats 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!