Display number with engineering notation
Show older comments
I'm trying to display a number I read in with textscan in engineering notation. I was trying to switch the format to short eng and do:
evalc('disp(x)')
But it doesn't matter what format I set, the format textscan reads it in is what it uses.
1 Comment
Harry Dymond
on 31 May 2020
Edited: Harry Dymond
on 31 May 2020
For the benifit of those stumbling across this old thread in search of answers: please see my answer below
Accepted Answer
More Answers (2)
Harry Dymond
on 31 May 2020
3 votes
For the benifit of those stumbling across this old thread in search of answers: my FEX submission num2eng will do this, and offers SI prefixes as well as engineering notation.
owr
on 8 Nov 2011
0 votes
Try sprintf with a format string. It converts the number to a text string with a format of your choosing. Some built in MATLAB functions use this trick, for example, edit the code for dlmread.
Categories
Find more on Entering Commands 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!