Finally, the issue was circumvented by the joint use of the "fmincon" function and some global variables. Note: the global variables of each type (double, logical) must be declared on different lines.
Daniel
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!