Replace specific/diagonal elements in Matrix using editor, scripting
이전 댓글 표시
Hello,
Looking a simple way to replace diagonal values in vector to 0. The matrix is a variance-covariance matrix, however in system will be assuming covariance are
zero, and are independent to each. Have the following matrix:
A = [ 2.5 0.25; 0.25 2.4]
B = flip(A) %Flipped to get in correct orientation to select diagonals 0.25, 0.25
%Not sure if it is possible to select mirrored diagonal in original matrix A
Covariance values are 0.25, which would like to set to zero. However these value could change, therefore if had method to replace these diagonal values with respect to m-row, n-column position, or other method?
If can be selected from original matrix A, would be ideal to avoid flipping.
Thanks in advance
kind rgds
댓글 수: 2
Max Murphy
2020년 1월 6일
Will your system always be a bivariate distribution or will A ever be larger than 2x2?
Vincent Hodnett
2020년 1월 6일
편집: Vincent Hodnett
2020년 1월 6일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!