Afficher commentaires plus anciens
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
Réponses (3)
Krishnendu Mukherjee
le 18 Fév 2012
0 votes
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 commentaires
Aseel H
le 18 Fév 2012
Krishnendu Mukherjee
le 19 Fév 2012
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
Krishnendu Mukherjee
le 19 Fév 2012
i was in hurry yesterday.thats why little mistake
Andrei Bobrov
le 18 Fév 2012
A = 1234567891234567
B = reshape(num2str(A)-'0',[],2).'
Anew = B*10.^(size(B,2)-1:-1:0).'
Walter Roberson
le 18 Fév 2012
0 votes
Your A is 16 digits long. You might not be able to store it accurately as a floating point number.
Catégories
En savoir plus sur Matrices and Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!