MATLAB: How do you create a matrix Aij where each value is determined by a formula arrayarrayscell arraysMATLABmatrixmatrix array Eg: Aij = (-1)^i+j Where i and j are the row and column indexes respectively. So a 2 dimensional matrix, A, would be: A = 1 -1 -1 1 Best Answer [I,J] = ndgrid(1:2,1:2);(-1).^(I+J) Related SolutionsMATLAB: I have a nxn matrix. How to get two variables [m,n] corresponding to the elements of the row of the matrix.(Kindly see the image) B = reshape(A.',[],1);C = hankel(B(1:end-1),B(end-1:end));m = C(:,1);n = C(:,2);ors = size(A,2);m = A(:,1:s-1);n = A(:,2:s); MATLAB: Help with quadriatic formula You showed enough I'll do more than normally would on first response...s=inputdlg('Enter quadratic: ','Quadratic Solver Input',1,{'ax^2+bx+c'}); Related QuestionVariable order matrix with some constant value entryDefining formulas for diagonal and offdiagonal elements of a matrixHow to calculate this formula
Best Answer