How to create a custom matrix?

5 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by