So my problem was, when i'm trying to combine number from different columns, leading zeros disappear, here's my code:
Bthree= [0 0 1
9 1 2
0 5 7]
len=size(Bthree);
A=[];
for jj=1:len(1)
s=int2str(Bthree(jj,1:3));
s=s(s~=' ');
A(jj,:)=[str2num(s)];
end
Output
1
912
57
as you can see leading zeros disappear but i want zero to be keep
desired output:
001
912
057
so can i do that? thanks