M=2; S=[1,2];pos=size(S,2)^M;for i=1:M for j=1:pos X(i,j)=S(i) end end
This is not generic code…secondly the result i want is not perfect for the scenario i attached a pic of the scenario but need a generic code that will be valid for increasing M and s
Best Answer