I have a matrix which size is mxm (square) variable and I wanna assign a mx1 matrix into the first matrix's diagonal. What kind of loop I have to write?
이전 댓글 표시
for example;
%m=matrix's row which is variable depends on the input
a=zeros(m)
b=[mx1]
I wanna assign b matrix into the a matrix's diagonal.
댓글 수: 3
Azzi Abdelmalek
2013년 5월 19일
Give a small example, and tell what should be the result
sermet
2013년 5월 19일
Image Analyst
2013년 5월 19일
I was going to suggest the cyclist's third method, which he posted before your comment above. Did you try it?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!