MATLAB: Save values in array

save values in array

I have
A={[1,6,3,2],[3,5,6]};
all_el =[];
for i=1:length(A)
all_el(end)=A{i}
end
I want to have this result
all_ell=[1,2,3,5,6]

Best Answer

all_el = unique([A{:}]);