How to create a custom matrix?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hadi Ghahremannezhad
le 25 Nov 2019
Réponse apportée : Rik
le 25 Nov 2019
I want to create a matrix that look like this:
![435.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/250227/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 commentaires
Réponse acceptée
Rik
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!