How to create a custom matrix?

조회 수: 11 (최근 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 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