How can i split a large integer into fix size groups?

I have a large integer/hexadecimal value:
2329363532333233313131363536353635254B53484744534A4844534A4B4A4B4A4B6146484A484A765E383838382A2A2A2A2F313432333600
I want to split it into groups of 47 each..the last group may contain less than 47 digits. eg. output
group1:2329363532333233313131363536353635254B534847445
group2:34A4844534A4B4A4B4A4B6146484A484A765E383838382
and so on.

 採用された回答

Stephen23
Stephen23 2018 年 2 月 27 日
編集済み: Stephen23 2018 年 2 月 27 日

1 投票

>> S = '2329363532333233313131363536353635254B53484744534A4844534A4B4A4B4A4B6146484A484A765E383838382A2A2A2A2F313432333600';
>> M = 47;
>> N = numel(S)-1;
>> V = [M*ones(1,floor(N/M)),1+mod(N,M)];
>> C = mat2cell(S,1,V);
>> C{1}
ans = 2329363532333233313131363536353635254B534847445
>> C{2}
ans = 34A4844534A4B4A4B4A4B6146484A484A765E383838382A
>> C{3}
ans = 2A2A2A2F313432333600

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by