Transforming vector into triangular matrix
조회 수: 18 (최근 30일)
이전 댓글 표시
Hi guys,
I've got a 48x1 vector say [x1; x2; x3; x4;...x48]
I want to transform this into a 48x48 matrix that looks like:
x1 0 0 0 ...
x1 x2 0 0 ...
x1 x2 x3 0 ...
x1 x2 x3 x4 ...
....
What are some of the ways to do this? I know I could use diag() but that would only get me 1 diagonal line. Or should I try and use tril()? Thanks!
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!