Display number with engineering notation
123 views (last 30 days)
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:
But it doesn't matter what format I set, the format textscan reads it in is what it uses.
Walter Roberson on 8 Nov 2011
My tests disagree with Jared's findings:
>> result = textscan('133423.3e7','%f')
>> format short eng
Engineering format was indeed used for the output, and the output is not the same as the format of the value that was read in nor of the format the data was stored in
More Answers (2)
owr on 8 Nov 2011
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.