I have some trouble when creating matrix 4×2 with rules like below. the first column are integer and the other column are random number. I already create the syntax below.
for ii = 1:8, nilai = mod(ii,2); if nilai == 0 x(ii) = 0.95 + (1.05-0.95)*x(ii); elseif nilai ~= 0 x(ii) = round(3 + (30-3)*x(ii)); elseif nilai ~= 0 x(ii) = 0.01 + (0.055-0.01)*x(ii); else x(ii) = 1.0 + (1.15-1.0)*x(ii); end endx = reshape(x,4,2)';
but the result are
??? Error using ==> reshapeTo RESHAPE the number of elements must not change.
anyone can help me with this problem..? any solutions are very welcome..
thank you.
Best Answer