Transforming vector into triangular matrix
19 ビュー (過去 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!