MATLAB: Creating a vector from the diagonal values of a square matrix creating a vector from the diagonal values of a square matrix Hello, Does anybody know how I can read the diagonal values of a square matrix and create a vector (1:n) from those values? Cheers, Cyrus Best Answer vector=diag(matrix);check help diag for more detailed information. Related SolutionsMATLAB: Finding the diagonal vector from a square matrix A = [2 9 4; 4 9 2; 1 5 0]fliplr(diag(flipud(A))') MATLAB: Eigenvalues and orthonormal eigenvectors Yes there is. Look at the eig function. Related QuestionDiagonal of a non-squared martrixWhat is the inversion method used in (inv) function in MATLABChange diagonal place
Best Answer