minRequiredRows = 0;
minRequiredColumns = 0;
for k = 1 : length(Phi_NuMax)
thisMatrix = Phi_NuMax{k};
[thisRows, thisColumns] = size(thisMatrix);
fprintf('Cell #%d has %d rows and %d columns.\n', k, thisRows, thisColumns);
minRequiredColumns = max(minRequiredColumns, thisColumns);
minRequiredRows = minRequiredRows + thisRows;
end
fprintf('At a minimum, you will require %d rows and %d columns.\n', k, minRequiredRows, minRequiredColumns);
allMatrixes = zeros(minRequiredRows, minRequiredColumns);
currentRow = 1;
for k = 1 : length(Phi_NuMax)
thisMatrix = Phi_NuMax{k};
[thisRows, thisColumns] = size(thisMatrix);
fprintf('Inserting cell #%d with %d rows and %d columns.\n', k, thisRows, thisColumns);
allMatrixes(currentRow : currentRow + thisRows - 1, 1:thisRows) = thisMatrix;
currentRow = currentRow + thisRows;
end
Best Answer