Problems with using Eigs for a function
显示 更早的评论
Hi,
I have problems with the interface of eigs(). I have a matrix T
T= [A B
C D]
where matrix vector multiplication can be implemented with FFT for the block D, and the rest are sparse. Hence I have created a function for T rather than a matrix. I want to compute some of the eigenvalues of T, but have problems with the interface of eigs(). I have tried different ways of calling eigs but it always gives me errors.
Note: I did read the manual and when implementing T as an ordinary matrix it works fine... I'm also aware of that the function sent to eigs should implement "T\b" but now I'm just trying to figure out the interface.
When T is implemented as a sparse matrix, the following call works fine
[v_initial, eigenvalue] = eigs(T_old, 1, 'sm');
But when I use T as a function I get the following error:
Error using eigs/checkInputs (line 496)
Generalized matrix B must be the same size as A.
Error in eigs (line 93)
[A,Amatrix,isrealprob,issymA,n,B,classAB,k,eigs_sigma,whch, ...
In the debugger I can see that the matrix B now has gotten the value 'sm'. Just because I shifted from explicit matrix to function, the interface changed...
Question: How is the interface when you use a function instead of an explicit matrix?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!