Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

how can i get output

2 views (last 30 days)
mukim
mukim on 16 Jan 2013
Closed: MATLAB Answer Bot on 20 Aug 2021
input sample: x=[43 03 00 10]
output sample: y= 43030010
how can i get this output ???

Answers (3)

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

Azzi Abdelmalek
Azzi Abdelmalek on 16 Jan 2013
Edited: Azzi Abdelmalek on 16 Jan 2013
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 on 16 Jan 2013
Edited: Thorsten on 16 Jan 2013
str2num(sprintf('%02d', x))

This question is closed.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!