Error processing function in matlab
I want to call the handle to the model_jacobian function, but I get "Error using ==> horzcat. CAT argument arguments are incompatible." When I select a function that leaves both a and d characters in jacobian, everything works fine.
syms adx; syms_function = a*x+d; model_jacobian = matlabFunction(jacobian(syms_function, [ad]), 'vars', {[ad], x}); J = model_jacobian([1 1], [1 2 3 4 5 6 7 8 9]'); So, how to call a function descriptor with arguments, despite the fact that they are not used there?
You probably solved this, but you can revise your vars specification. The documentation states:
The value of this parameter must be either an array of row cells or symbolic arrays, or a vector of symbolic variables
You have an array of character cells that doesn't seem to be correct. I would just keep it simple:
'vars',[ adx])