how can i get output
1 次查看(过去 30 天)
显示 更早的评论
input: "391632"
i want output:
i=39, j=1632
how can i get it??
采纳的回答
更多回答(3 个)
Andrei Bobrov
2013-1-16
编辑:Andrei Bobrov
2013-1-16
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)'];
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!