Info

此问题已关闭。 请重新打开它进行编辑或回答。

how can i get output

2 次查看(过去 30 天)
mukim
mukim 2013-1-16
关闭: MATLAB Answer Bot 2021-8-20
input sample: x=[43 03 00 10]
output sample: y= 43030010
how can i get this output ???

回答(3 个)

Andrei Bobrov
Andrei Bobrov 2013-1-16
if
x = [43 3 0 10]; % double array
y = x*10.^(6:-2:0);

Azzi Abdelmalek
Azzi Abdelmalek 2013-1-16
编辑:Azzi Abdelmalek 2013-1-16
x= [43 3 0 10]
y=[]
for k=1:numel(x)
y=[y num2str(x(k))];
end
y=str2num(y);
%or
y=str2num(cell2mat(arrayfun(@num2str,x,'un',0)))

Thorsten
Thorsten 2013-1-16
编辑:Thorsten 2013-1-16
str2num(sprintf('%02d', x))

此问题已关闭。

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by