How to create a custom matrix?

4 ビュー (過去 30 日間)
Hadi Ghahremannezhad
Hadi Ghahremannezhad 2019 年 11 月 25 日
回答済み: Rik 2019 年 11 月 25 日
I want to create a matrix that look like this:
435.png
The first n rows are all 0. The second n rows are calculated separately by some operation like:
W * V
Where W is a diagonal (n * n) matrix and V is an (n * 3) matrix.
How can I do this?

採用された回答

Rik
Rik 2019 年 11 月 25 日
This is a simple contatenation:
n=8;
%generate W and V
W=randi(20,n,n);
V=randi(5,n,3);
output=[zeros(n,3) ; W*V];

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by