MATLAB: Negative index of a matrix negative indexnegative index of a matrix for n=1:5for m=-n:na(m,n)=m*nendendend I got an equation like this but I got negative indexes , how can I solve this problem? Thanks for helping. Best Answer for n = 1:5 m = -n:n; for i = 1:numel(m) A(i, n) = m(i)*n; end end Related SolutionsMATLAB: Negative index of matrix Like thism = 3:-1:-3;n = 3:-1:-3;for i = 1:numel(m) for j = 1:numel(n) Y( i,j) = G(center_index + (m(i)-n(j))) + (-1i*m(i)*w*C(center_index + (m(i)-n(j))));endend MATLAB: I have the following code .its showing ” subscript indices must be either real positive integer or logicals”.Plz anyone answer whr is d problem 5-n is 0 when n is 5 in your loop. 0 is not a positive integer. Related QuestionGenerate matrix that is a product of its indicesRemove negative numbersWhat’s wrong with this codeHow to index a random matrix with set conditions
Best Answer