How to create matrix with array under certain conditions?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an array:
A=[1.3 1.2 1.3]
How can I get matrix B using A?
B=[1.3 1.3 1.3; 1.3 1.2 1.3; 1.3 1.3 1.3]
Matrix B has the value of A at the central row,column,and diagonal.
댓글 수: 1
José-Luis
2013년 5월 3일
You mean two diagonals? Otherwise two of the values of the resulting matrix are undefined.
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!