How avoid exponential notation in compose
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
hi, i want to avodi exponential notation
compose("%d",daily)
...
"-250"
"1.562500e+02"
"-3.750000e+01"
correct is .
"-250"
"156.25"
"-37.5"
0 Commenti
Risposte (2)
Stephen23
il 24 Giu 2024
Modificato: Stephen23
il 24 Giu 2024
"How avoid exponential notation in compose"
Explanation: the %d conversion is for integer values. Are all of your data integer valued? (hint: no). The documentation states "If you specify a conversion that does not fit the data, such as a text conversion for a numeric value, MATLAB® overrides the specified conversion, and uses %e." By definition the %e conversion uses exponent notation.
Solution: specify a more suitable conversion, e.g. %g
daily = [-250; 156.25; -37.5];
compose("%.5g",daily)
Vedere anche
Categorie
Scopri di più su System Composer in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!