Create a row vector of the diagonal elements from matrix.

So I am knew to MATLAB and have a question reguarding matricies.
I'm wondeirng how to create a row vector from the diagonal values (Top left to bottom right) from a matrix (I'm using a 6x6 matrix).
Any advice would be much appreaciated.
Thanks,
Ben.

 채택된 답변

Star Strider
Star Strider 2020년 10월 17일

0 개 추천

Meet the diag function!

댓글 수: 2

it works, thanks guys so much
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

질문:

2020년 10월 17일

댓글:

2020년 10월 17일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by