MATLAB: Having array trouble

array

i'm having trouble on manipulating the array form. according to the code below, i try to save the result inform of array so that it can be call outside the loop. but the size of or each row are different and the error appeared as:
Error using vertcat
CAT arguments dimensions are not consistent.
clear; clc;
DG = [0 1 0 0 0; 0 0 1 1 1; 0 0 0 0 1; 0 0 0 0 1; 0 0 0 0 0]
save=[];
for i = 1:5
child = find(DG(i,:))
save = [save; child];
end
can anyone help me to correct this problem, i'm really appreciate it. thank you..

Best Answer

Use cell
save = [save; {child}]
BTW I strongly suggest you to change the variable name, save, because it is one of MATLAB's function name.