simple way to multiply varying parameter with matrice
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
steffen seligmann
el 23 de Sept. de 2020
Respondida: Ameer Hamza
el 23 de Sept. de 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 comentarios
Respuesta aceptada
Ameer Hamza
el 23 de Sept. de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!