Filter löschen
Filter löschen

how can i get output

1 Ansicht (letzte 30 Tage)
mukim
mukim am 16 Jan. 2013
input: "391632"
i want output:
i=39, j=1632
how can i get it??
  1 Kommentar
Walter Roberson
Walter Roberson am 16 Jan. 2013
Is the input a string or numeric?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Jan. 2013
A = 391632
i = floor(A/10000);
j = mod(A, 10000);

Weitere Antworten (3)

Andrei Bobrov
Andrei Bobrov am 16 Jan. 2013
Bearbeitet: Andrei Bobrov am 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
mukim am 16 Jan. 2013
the input is numeric input: 391632

mukim
mukim am 16 Jan. 2013
tnx.. Walter Roberson .. :)

Kategorien

Mehr zu Chemistry finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by