Hi Esben,
The error you're encountering is likely due to a mismatch in dimensions when using the eigs function with a function handle. The eigs function expects the function handle to represent a linear operator that can be applied to a vector, returning another vector of the same size. In your case, the function handle fwd_1 or fwd_2 should apply the transform to a vector, not a matrix.
- Function Handle Expectations: The eigs function expects afun to be a function handle that accepts a vector and returns a vector of the same size. Your current setup applies the transformation to a matrix, which isn't compatible with eigs.
- Matrix to Vector Conversion: Since eigs works with vectors, you need to reshape the input matrix into a vector, apply the transformation, and then reshape the result back into a vector.
Hope this helps.