How can I properly format small numbers using num2str?
Mostra commenti meno recenti
I was assigned to work on the aesthetics of a table that shows collected data as string.
I want to show the numbers with 4 digits percision, but whenever the number is bigger the 10e-5, the output will include all the zeros, and only the four digits, e.g:
x=0.000123456;
y=0.0000123456;
solx=num2str(x,'%.4G');
soly=num2str(y,'%.4G');
solx
soly
Is there any way that I can get solx to be formatted like soly?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Other Formats in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!