I have a function like the following:

`function y=testfuncopt(a,b,c)y=a(1).^2+a(2).^2-b(1).^2-2*b(2).^2+c;`

Now I want to evaluate the function for an initial value x0:

`x0=[1,2,3,2,1]objective =@(a,b,c) @testfuncopt;disp(['Initial Objective: ' num2str(objective(a,b,c))])`

The follwoing error happening:

`Undefined function or variable 'a'.Error in testopt1 (line 12)disp(['Initial Objective: ' num2str(objective(a,b,c))])`

## Best Answer