MATLAB: Change cell dimension

celldimension

hi all y teachers,
i have a cell :
a = {{8x1cell} {14x1cell} {11x1cell} {23x1cell} {17x1cell} {8x1cell} {18x1cell} {14x1cell} {20x1cell} {28x1cell}}
i need to change the dimension of each cell to a fix number, say 50×1 cell. So each cell will have dimension 50×1, and i want the rest rows of the cell to be 0 or []
ex: take the 1st col of the cell, it's 8x1cell and i need it to be 50×1 with 42rows left to be zero or []
old 8x1cell = {'i'; 'need'; 'a'; 'glass'; 'of'; 'water'; 'right'; 'now'}
new 8x1cell = {{'i'; 'need'; 'a'; 'glass'; 'of'; 'water'; 'right'; 'now'; 0; 0; … till row 50}
is there any possible way i can perform that? really need your helps, plzz! 🙁
thx,
Maya

Best Answer

for k=1:length(a)
a{k}(end+1:50={[]}; %pad with []
%a{k}(end+1:50={0}; %pad with []
end