separate and regenerate

1 回表示 (過去 30 日間)
Majid Al-Sirafi
Majid Al-Sirafi 2012 年 3 月 20 日
High everyone How can I separate the no. into several numbers ….change on of them and regenerate it. For example I have the following no. 3456 , how can I separate it into 3,4,5 and 6 numbers …. and for example change 4 into 13… and regenerate the no to be 31356

採用された回答

Wayne King
Wayne King 2012 年 3 月 20 日
You can first transform the number into a string:
x = 3456;
y = num2str(x);
y = [y(1) '13' y(3:end)];
x1 = str2num(y);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLaTeX についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by