Display number with engineering notation
古いコメントを表示
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 件のコメント
Harry Dymond
2020 年 5 月 31 日
編集済み: Harry Dymond
2020 年 5 月 31 日
For the benifit of those stumbling across this old thread in search of answers: please see my answer below
採用された回答
その他の回答 (2 件)
Harry Dymond
2020 年 5 月 31 日
3 投票
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
2011 年 11 月 8 日
0 投票
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.
カテゴリ
ヘルプ センター および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!