adding trailing 0s to inputted numbers
37 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Is there a way to add trailing 0s after they are inputted in MATLAB (ex turning 4 -> 4.0 or 4.00?) my code wont work unless the sigfigs match but i found rounding them in the matrix using M = round(M,4,"decimals") or M = round(M,4,"significant") just keeps it at the same integer value.
Thank you!
1 Commento
Risposte (1)
Eric Delgado
il 19 Set 2022
You have to use strings to control the number of decimals.
sprintf('%.1f', 4)
sprintf('%.2f', 4)
sprintf('%.6f', 4)
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!