I have some algorithm including a while loop:
while
while (condition) % do something and return a result array B end
Let\'s say:<
You can make use of the end keyword
end
% Initialise empty cell array A = {}; while *condition* % Create B using some calculation (different each loop) B = [1 2 3]; % Other code ... % Assign to array A{end+1} = B; end