I want to create a series of sets C that
… …
So i use the code
N = 10;C{1} = []; % C_0 because MATLAB index starts from 1
C{2} = 1:N;C{3} = zeros(1,length(C{2})*N);count = 0;for r = 1:length(C{2}) ri = C{2}(r); for s = ri+1:N count = count + 1; ri2 = [ri,s] C{3}(count) = ri2; % Error: Unable to perform assignment because the left and right sides have a different number of elements.
endendC{3} = C{3}(C{3}~=0);
How can i fix this code and improve efficiency?
Thanks
Best Answer