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

flip(sprintf('%d',4530),2)

3 Comments

Thank you so much Sir. Can you please explain me how this syntax works sir.
Andrei Bobrov
Andrei Bobrov on 24 Aug 2018
Edited: Andrei Bobrov on 24 Aug 2018
Please read help for Matlab
Ok sir,Thank you

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!