How to truncate textscan reading
Afficher commentaires plus anciens
Dear all,
perhaps a simple question for you, but I don't understand properly how formatspec in textscan works.
I have to read the written value from a a TXT file, exactly written as 5.00000000159E-6. I would like to read it as 5E-6 i.e. I would like to truncate the last digits, which have no meaning.
I am using currently the format spec '%f'. How can I truncate the number in the way I want? Should I add a '%*f' specification? How should it work in my case?
Thanks for answering.
Regards,
E
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Large Files and Big Data dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!