how can i get output
Afficher commentaires plus anciens
input: "391632"
i want output:
i=39, j=1632
how can i get it??
1 commentaire
Walter Roberson
le 16 Jan 2013
Is the input a string or numeric?
Réponse acceptée
Plus de réponses (3)
Andrei Bobrov
le 16 Jan 2013
Modifié(e) : Andrei Bobrov
le 16 Jan 2013
s = '391632';
out = str2double(mat2cell(s,1,[2 4]));
or
a = s - '0';
out = [polyval(a(1:2),10), polyval(a(3:end),10)];
or
a = s - '0';
out = [a(1:2)*[10; 1], a(3:end)*10.^(3:-1:0)'];
mukim
le 16 Jan 2013
0 votes
mukim
le 16 Jan 2013
0 votes
Catégories
En savoir plus sur Particle & Nuclear Physics 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!