How to keep scientific notation in string.
46 views (last 30 days)
Show older comments
Answered: Walter Roberson on 14 Dec 2021
I have some values in an array in matlab
I want to turn these values into a string so I can use them on plots etc.
but the output is not in scientific format :
stringeps="0.1" "0.89" "0.08"
how do I make it appear in scientific format.
Awais Saeed on 14 Dec 2021
Edited: Awais Saeed on 14 Dec 2021
% try num2str()
str1 = string(num2str(epsilon,'%.e '))
% or try sprintf()
str2 = string(sprintf('%.e ',epsilon))
Walter Roberson on 14 Dec 2021
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!