Error in creating a function

1 view (last 30 days)
What's wrong in the following expression?
ObjectiveFunction = @x() sim(net, x')
  2 Comments
Stephen23
Stephen23 on 2 Aug 2018
@x() sim(net, x')
^^^
should be:
@(x) sim(net, x')
^^^

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 2 Aug 2018
Edited: madhan ravi on 2 Aug 2018
hi try this,
ObjectiveFunction = @(x) sim(net, x')
REASON: FUNCTION HANDLE SHOULD BE DETERMINED INSIDE PARENTHESES.

More Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!