필터 지우기
필터 지우기

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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by