how can i get output

input sample: x=[43 03 00 10]
output sample: y= 43030010
how can i get this output ???

Réponses (3)

Andrei Bobrov
Andrei Bobrov le 16 Jan 2013

0 votes

if
x = [43 3 0 10]; % double array
y = x*10.^(6:-2:0);
Azzi Abdelmalek
Azzi Abdelmalek le 16 Jan 2013
Modifié(e) : Azzi Abdelmalek le 16 Jan 2013

0 votes

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 le 16 Jan 2013
Modifié(e) : Thorsten le 16 Jan 2013

0 votes

str2num(sprintf('%02d', x))

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Question posée :

le 16 Jan 2013

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by