split array
6 ビュー (過去 30 日間)
古いコメントを表示
if A = [1234567891234567];===> size(A) = 1*1
in one cell
I want split it as each (8digit) in one cell as:
A = [12345678;91234567];=====> size(A)= 2*1
0 件のコメント
回答 (3 件)
Krishnendu Mukherjee
2012 年 2 月 18 日
for i=1:(size(A(1,:))/2) B(1,:)=A(1,i); end for i=(size(A(1,:))/2):size(A(1,:)) B(2,:)=A(1,i); end try this.it may work
3 件のコメント
Krishnendu Mukherjee
2012 年 2 月 19 日
for i=1:(size(A(1,:))/2) B(1,i)=A(1,i); end for i=(size(A(1,:))/2):size(A(1,:)) B(2,i)=A(1,i); end try this.it may work
1 comment
Andrei Bobrov
2012 年 2 月 18 日
A = 1234567891234567
B = reshape(num2str(A)-'0',[],2).'
Anew = B*10.^(size(B,2)-1:-1:0).'
0 件のコメント
Walter Roberson
2012 年 2 月 18 日
Your A is 16 digits long. You might not be able to store it accurately as a floating point number.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!