How do I make a univariate function handle out of a multivariate function?

A
Anaishasingh · Jul 31, 2020 · 2K views
Question
I want to use the eigs function with function handle input:   d = eigs(Afun,n,___) Here Afun is a function handle, which -for generic vector x- returns A*x, i.e. Afun(x) = A*x. I have a function, let's say Aasfunction(x,lambda), which indeed returns A*x, and A depends on a parameter lambda: A=A(lambda). How can I create a univariate function handle from Aasfunction(x,lambda), with one input, and fix lambda in the definition? (I guess I can alway define a function Awithfixedlambda(x)=Aasfunction(x,lambda), and lambda is fixed to some numerical value inside the function definition, but I'm looking for a solution, where I can avoid this.)
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 12, 2026

 it seems the following works:

 

lambda=...; %define lambda at whaatever value you want
Afun=@x Aasfunction(x,lambda);
eigs(Afun,...) %there is a necessary second parameter, the dimension of A, which needs to be specified
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!