MATLAB: Help with Array Induces (left and right side are incompatible)

MATLABmatlab induces simulation stadistic stochastic process loop index array size left right code incompatible

The following code: …
Gets me the error
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Error in Title_here (line 40)
k(j)=B(1,:);
If I need the code to save each loop of n results to later make an histogram of all the results of said loop m times. then how should I do it so it works?

Best Answer

k = cell(1); % before loop
k{i}=B(1,:) %change this