Borrar filtros
Borrar filtros

How to remove decimal points in the Workspace

8 visualizaciones (últimos 30 días)
Bradley
Bradley el 11 de Jun. de 2024
Editada: Adam Danz el 11 de Jun. de 2024
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!

Respuestas (1)

Adam Danz
Adam Danz el 11 de Jun. de 2024
Editada: Adam Danz el 11 de Jun. de 2024
See format to set output display format.
format shortg
or if you always want 2 decimal places,
format bank

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by