I think it’s expecting a “matrix-like” object that supports a size method, not just a function. However, you can wrap a “matrix-like” object around your function with LinearMaps.jl, in particular with LinearMap(x->matmap(x,aa,bb), Nx) which creates an object that has size == (Nx, Nx).
4 Likes