Error in creating a function

What's wrong in the following expression?
ObjectiveFunction = @x() sim(net, x')

2 Comments

@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)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!