MATLAB: Editing in string array MATLABstring a={'10','7','5','9','11','12','12','4'} I want to put 0 at the starting of all those whose length is 1. How can I do this easily? Best Answer a={'10','7','5','9','11','12','12','4'} ;L = cellfun(@length,a) ;idx = L==1 ;a(idx) = strcat('0',a(idx)) ; Related SolutionsMATLAB: Manipulation of a cell array- Cell_array = {1,[],magic(2);'stirng',[],[]}cellfun('isempty',Cell_array) MATLAB: Keep index of omited array find(N==2) Related QuestionConvert an 18×1 cell array in a 3×6 cell arrayDelete empty [] {1×7 cell} {1×2 cell}How to generate random integer between two no (say 12 and 35) without repeat? randperm(n) give only 1 to n, but I need m to n.Combine a cell array of cell arrays to a single cell arrayCreate a Matrix from different ccella array.Does the output of CELL2MAT have fewer elements than the cell array that I pass in
Best Answer