how to reverse an integer

2 views (last 30 days)
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.

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 23 Aug 2018
flip(sprintf('%d',4530),2)
  3 Comments
Andrei Bobrov
Andrei Bobrov on 24 Aug 2018
Edited: Andrei Bobrov on 24 Aug 2018
Please read help for Matlab

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!