MATLAB: How to replace double vectors from 0 to ‘000’

how to replace double vectors from 0 to '000'

hello every body; i am dealing with string and number how i can solve this problem: "In an assignment A(I) = B, the number of elements in B and I must be the same." "E_extrac_pro(ex_loop2)='000';" where numbers vector are double and contains:
numbers=[202;0 ;20;0;0;1013;10];
for ex_loop2=1:size(numbers)
if(numbers(ex_loop2)==0)
E_extrac_pro(ex_loop2)='000';
else
E_extrac_pro(ex_loop2)=numbers(ex_loop2);
end
end

Best Answer

Why bother with the loop at all?:
>> numbers=[202;0 ;20;0;0;1013;10];
>> X = num2str(numbers,'%04g')
X =
0202
0000
0020
0000
0000
1013
0010
And if the output must be a cell array:
>> cellstr(X)
ans =
'0202'
'0000'
'0020'
'0000'
'0000'
'1013'
'0010'