How can I use the number of variables as expression in a logical if Statement?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a function that operates with two function handles as input arguments and creates the hessian matrix of another function later. I want to calculate the eigenvalues of that hessian matrix at certain points, so that I converted the matrix into a function handle using 'matlabFunction'.
The problem I got now is that I don't know, whether the hessian matrix is a function in x and y, in only one or in none variables, so that the input hessian(x,y) is not defined if there are less then two variables. My idea is to seperate the cases in an if-statement so that I can have only one input, but I don't know what kind of expression would fit for the condition and how to seperate the cases when there is one variable in the matrix, like P=[1;0] hessian=[1 0; 0 y].
9 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!