fun = @(lambda) det(A - lambda*eye(size(A)));
fun is a function of the unknown variable lambda. It is a function handle. It has A built into the function handle workspace, so any tool that gets passed the function fun can use it.
Now, you can use a tool like fzero on fun, solving for values of lambda that make fun equal to zero. Note that fzero only returns ONE solution for any time it is called, and you may get different solutions based on different starting values or starting intervals. So you will need to use fzero intelligently.
For example,
fun = @(lambda) det(A - lambda*eye(size(A)));
Now you can evaluate fun.
Again, what remains for you to do is to understand how to solve the problem, how to pass fun to a root finder, like fzero or fsolve, and to do that multiple times. Or perhaps you will be forced to use your own root finding tool, written for some past assignment.
One hopes that your instructor has not given you a matrix with replicated eigenvalues. That would be a nasty trick to really confuse a student, but then students are there to be confused in the eyes of some people. :)
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/709253-how-to-define-a-variable-without-using-syms#comment_1245733
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/709253-how-to-define-a-variable-without-using-syms#comment_1245733
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/709253-how-to-define-a-variable-without-using-syms#comment_1245848
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/709253-how-to-define-a-variable-without-using-syms#comment_1245848
Sign in to comment.