how to reverse an integer

1 visualización (últimos 30 días)
Rajashree Annapillai
Rajashree Annapillai el 23 de Ag. de 2018
Comentada: Rajashree Annapillai el 25 de Ag. de 2018
Hi,I have to reverse a number.Ex.4530 .I have to print this number as 0354 and not as 354.Is there any way to print the number including '0' also.Please help!Thank you.

Respuesta aceptada

Andrei Bobrov
Andrei Bobrov el 23 de Ag. de 2018
flip(sprintf('%d',4530),2)
  3 comentarios
Andrei Bobrov
Andrei Bobrov el 24 de Ag. de 2018
Editada: Andrei Bobrov el 24 de Ag. de 2018
Please read help for Matlab
Rajashree Annapillai
Rajashree Annapillai el 25 de Ag. de 2018
Ok sir,Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by