Hello everyone. I am wondering if in Matlab, one can use symbolic variables together with fsolve. I have to equate a gradient (calculated from substituted variables) to zero. Here is what I tried. Could anyone tell me what is wrong with this? If I can't use fsolve with symbolic value equations, how could I solve for 2 nonlinear symbolic valued equations with two unknowns? Tks:
function gradB = myfun(X)syms X(1) X(2) n mB = subs(X(1)+ X(2), [X(1), X(2)], [n+m, n-m]);gradB = gradient(B, [n, m])ScriptX0 = [...];fhandle = @myfun;X = fsolve(fhandle, X0)
Best Answer