how to reverse an integer

2 ビュー (過去 30 日間)
Rajashree Annapillai
Rajashree Annapillai 2018 年 8 月 23 日
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.

採用された回答

Andrei Bobrov
Andrei Bobrov 2018 年 8 月 23 日
flip(sprintf('%d',4530),2)
  3 件のコメント
Andrei Bobrov
Andrei Bobrov 2018 年 8 月 24 日
編集済み: Andrei Bobrov 2018 年 8 月 24 日
Please read help for Matlab
Rajashree Annapillai
Rajashree Annapillai 2018 年 8 月 25 日
Ok sir,Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by