simple way to multiply varying parameter with matrice
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
steffen seligmann
le 23 Sep 2020
Réponse apportée : Ameer Hamza
le 23 Sep 2020
Hello,
My goal is to to diag() my matrice and then plot the eigenvalues over the parameter. since both *, .* are not helpful in this situation is there any very simple way to archieve my goal without having to use any for loops or such?
3 commentaires
Réponse acceptée
Ameer Hamza
le 23 Sep 2020
Try this
A = rand(2,2);
param = 0:0.1:2;
M = arrayfun(@(x) {x*A}, param);
M = blkdiag(M{:});
It multiplies A with all values in param and places the output on diagonals of matrix M.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!