GA Optimization - Error Message
Show older comments
Hello.
I have an optimization problem that is to be solved through 3 iteration "t".
Starting from the 2nd iteration, the constraint function follows some conditions.
My problem is that my code runs only for the 1st iteration while for 2 remaining iterations, I always get the error message as indicated by the attached screenshot "Error Message".
Can you anyone help me dealing with and fixing the error I'm having?
Regards.
===============
NB:
Optimization code => OptimCode.m
Constraint Function => ConstFun.m (it calls the 2 functions, Layer_L_Fcn and Layer_U_Fcn to formulate some constraints)
Objective Function => ObjFun.m
Accepted Answer
More Answers (1)
Execute dbstop if error at the command line
>>dbstop if error
and then re-run the optimization. The code will pause execution where the error has occurred. Go inside your objective function using the Function Call Stack in the DEBUG panel and observe what has caused the error.

8 Comments
Abderrahmane DADA
on 31 Aug 2019
Matt J
on 31 Aug 2019
I see no such line in your OBJFun.m file. Your OBJfun.m file only has 10 lines.
Matt J
on 31 Aug 2019
Try
>> dbstop if caught error
instead.
Abderrahmane DADA
on 31 Aug 2019
Matt J
on 31 Aug 2019
But my advice to you was to use the Function Call Stack drop down menu in the image I posted to go to your objective function.
Abderrahmane DADA
on 1 Sep 2019
Edited: Abderrahmane DADA
on 1 Sep 2019
Matt J
on 1 Sep 2019
Did you try
>> dbstop if caught error
Abderrahmane DADA
on 2 Sep 2019
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!