how to remove trailing zeros after rounding a matrix?
古いコメントを表示
I need to round a matrix to two decimal places but I want to get rid of those trailing zeros after the decimal point. Even I want to use that matrix for plotting also? How to do it?
回答 (1 件)
format short
A = 1.23
format shortG
A = 1.23
5 件のコメント
Deepthi B
2021 年 4 月 21 日
Stephan
2021 年 4 月 21 日
There is no way to show it in workspace the way you want. Then you would have to use some dirty tricks such as save it as char or sym - but is it worth this only because of the trailing zeros?
Deepthi B
2021 年 4 月 21 日
Stephan
2021 年 4 月 21 日
Can you provide the code?
Deepthi B
2021 年 4 月 21 日
カテゴリ
ヘルプ センター および File Exchange で Numbers and Precision についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!