simple way to multiply varying parameter with matrice
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Ameer Hamza
2020 年 9 月 23 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Red についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!