フィルターのクリア

How to remove decimal points in the Workspace

8 ビュー (過去 30 日間)
Bradley
Bradley 2024 年 6 月 11 日
編集済み: Adam Danz 2024 年 6 月 11 日
I want to remove decimal points in the workspace, I have a bunch of variables in the editor and want to be able to quickly reference the output in the work space but when i do they are in scientific notation. Ive tried changing the veiw but nothing works. Ill show an example below but some other things that I have tried is rounding, format longG and others, but nothing removes the decimal all together.
I have an excel sheet with alot of different variables, in numerous columns, I want to add all the values together to have just one total. Afterward Ill graph all of the different totals.
Heres how I am doing it now:
a1 =
339.750000000000
339.750000000000
339.750000000000
339.750000000000
339.750000000000
a2 = sum(a1);
output for a1 = 1.698750+03
a3 = round(a2,2);
after rounding, a3 = 1.698750+03
what I am looking for = 1698.75
When I open the variable in workspace I want it to look like the final number, 1698.75, instead of 1.698750+03. Any advice is appreciated!

回答 (1 件)

Adam Danz
Adam Danz 2024 年 6 月 11 日
編集済み: Adam Danz 2024 年 6 月 11 日
See format to set output display format.
format shortg
or if you always want 2 decimal places,
format bank

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by