How to format scientific notation to have the same power?
28 ビュー (過去 30 日間)
古いコメントを表示
Alfredo Scigliani
2021 年 12 月 7 日
コメント済み: Walter Roberson
2021 年 12 月 7 日
I know this might be dumb but it is messing me up so much. I have a table with data that is in scientific notation. I would like for all the numbers to be displayed to the same power of 10^-10. for example instead of 1.5e-9 , I would like it to be displayed as 15e-10.
MATLAB Script
----------------------------------------------------------------------------------------------------
clear; clc;
x=[702.8530e-012; 1.1511e-009; 1.0467e-009; 1.3369e-009; 723.8877e-012; 748.1630e-012; 1.0198e-009; 1.1897e-009]
number=[ 1; 2; 3; 4; 5; 6; 7; 8]
T=table(number,x)
------------------------------------------------------------------------------------------------------
I would like for all those e-9 to be e-10, does not matter if some numbers have more digits or significant figures than others, the only thing that I am looking for is that 10^-10 format.
if anyone can help, I appreciate it a lot!
0 件のコメント
採用された回答
Walter Roberson
2021 年 12 月 7 日
table() objects do not support that customization. You would need to switch the items to text
2 件のコメント
Walter Roberson
2021 年 12 月 7 日
x=[702.8530e-012; 1.1511e-009; 1.0467e-009; 1.3369e-009; 723.8877e-012; 748.1630e-012; 1.0198e-009; 1.1897e-009]
number=[ 1; 2; 3; 4; 5; 6; 7; 8]
T=table(number,x)
T.x = compose("%8.4f", T.x/1e-10) + "E-10"
The "8" part of the %8.4f might need to be adjusted if you had values that were higher scale relative to 1e-10 . Also note that values smaller than 1e-16 will show up as 0
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!