Question about single digits.

Hi everyone. Is there any function that converts "complex" number for example [123] to constituent elements [1 2 3] ?

 采纳的回答

Its not the most elegant, but this works:
A = str2num(num2str(123)')'

更多回答(1 个)

Artyom
Artyom 2012-7-13

0 个投票

Thanks. Maybe you know how to do the reverse process - from [5] [5] to [55]?

2 个评论

A = [ 1 2 3 ];
S = sum( A .* ( 10 ^ (numel(A)-1:-1:0 ) ) )

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by