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!