MATLAB Answers

Using an array as input argument of a function handle

3 views (last 30 days)
I have a jacobian matrix created using symbolic variables and I was evaluating it using "subs" command. However, I was recommended to use matlabFunction and handleing it as a function handle. The dymensions of the jacobian matrix depend on my system structure and therefore its size is variable, so I am trying to create a generic code.
There is no problem creating the function handle.
(...some code)
% Function handle of Jacobian
J = matlabFunction(J);
and J is:
J =
function_handle with value:
My problem comes here. If I design input arguments using a variable which is an array:
a = [1,1,1,1,0,0,0,0];
J_num = J(a);
I get the following error:
Not enough input arguments.
Error in
However, If I put it like this it works perfectly:
J_num = J(1,1,1,1,0,0,0,0);
Can anyone can help me?
Thank you in advance!!!


Sign in to comment.

More Answers (0)

Translated by