MATLAB Answers

How to create a custom matrix?

9 views (last 30 days)
Hadi Ghahremannezhad
Hadi Ghahremannezhad on 25 Nov 2019
Answered: Rik on 25 Nov 2019
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?

  0 Comments

Sign in to comment.

Accepted Answer

Rik
Rik on 25 Nov 2019
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 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags