MATLAB: Is it possible to grow cell matrices??

arrayscell arrayscellsdimensionsgrowMATLABmatrices

Hi all,
Is it possible to grow cell matrices? I am writing a script that analyzes strings and saves them to a cell array if they meet a criteria. I do not know how many sequences will produce matches therefore I cannot assign an initial dimension size to my matrix such as finallarray = cell(X,Y).
I want to start out by creating a matrix with a single three cell row and then adding an additional row with each new match.
Alternatively, I could create a single really large matrix that I know will not be filled up completely and than scan it at the and find the first row index with empty cells, and then save all of the cells above it to a second array whose size is determined by the number of cells. However, I do not know how to a check for an empty cell. what is the code for null (matrix{3,1} == null)?

Best Answer

It's best to pre-allocate the cell with the maximum possible size and then post-delete the empty cell entries using
YourCell( cellfun('isempty', YourCell) );