Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

could anyone help me how to remove the zeros that comes after the number present after the decimal

1 visualización (últimos 30 días)
how to display the matrix by removing the zeros that comes after the number.
[ 0 0.5800 1.3300 2.5300 2.1200 1.8100;
0.5800 0 1.8600 2.6100 2.4800 1.5300;
1.3300 1.8600 0 2.1800 1.1900 2.4200;
2.5300 2.6100 2.1800 0 1.2300 1.6200;
2.1200 2.4800 1.1900 1.2300 0 2.2400;
1.8100 1.5300 2.4200 1.6200 2.2400 0]
I want to have the matrix in the folowing manner
[ 0 0.58 1.33 2.53 2.12 1.81;
;;
;;
;;
;;
1.81 1.53 2.42 1.62 2.24 0]
could anyone please help me on it.

Respuestas (1)

Stephan
Stephan el 22 de Oct. de 2019
Editada: Stephan el 22 de Oct. de 2019
Use
format shortG:
A =
12.3400 2.3400
>> format shortG
>> A
A =
12.34 2.34

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by