I have a program where the user inputs an equation in the form of a string:
'2*a + 3*b = 5*c' % (just an example, it can be any linear equation)
in sequence I list the variables and take the Jacobian:
allvars = symvar(input);J = jacobian(input, allvars);
However, because of the "=" in the equation my output is:
J = [ 2 = 0, 3 = 0, 0 = 5]
and instead I *need*** it to be:
J = [ 2, 3, -5]
How can I solve this? Having the user input '2*a + 3*b – 5*c' is not an option.
I tried looking for a rhs/lhs (right/left hand side) function but there aren't any, the @children function is available only in R2012a and greater.
Best Answer