How to apply function eig to an array of matrices?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying to find the eigenvectors and eigenvalues of an array of matrices without doing a for loop. A simple example would be like:
A[:,:,1] = [1,2;3,4]
A[:,:,2] = [3,4;5,6]
...
A[:,:,10] = [19,20;21,22]
And the matrix elements can be arbitrary. My question is whether there is an efficient way to solve the eigen problem of each of these matrices without doing a for loop? Can tips of vectorization help us here?
0 Commenti
Risposte (2)
the cyclist
il 7 Lug 2019
Modificato: the cyclist
il 7 Lug 2019
cellfun(@eig,A,'UniformOutput',false)
or something like this, will be at the heart of your solution. You might need to read the documentation for cellfun and/or eig to get exactly the output you want.
0 Commenti
Bruno Luong
il 7 Lug 2019
If your matrices is 2x2 or 3x3 you can use this FEX for eigen values, then this one for engen vectors.
0 Commenti
Vedere anche
Categorie
Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!