Saving Data from intlinprog Custom Output/Plot Functions

2 vues (au cours des 30 derniers jours)
James Usevitch
James Usevitch le 10 Oct 2018
Modifié(e) : Matt J le 10 Oct 2018
I'd like to create a custom output/plot function for an optimization problem solved using intlinprog. Specifically, I'd like to save data on particular events in the optimization routine in the base workspace. However, the custom function syntax specifies that my custom function can only have a boolean output which is accessible only to the solver.
The built-in output function savemilpsolutions uses both evalin and assignin. I'm aware though that using global variables, evalin, and assignin are usually a bad idea. Are there any "safe" options that I can use to keep my custom function's data after the optimization routine is complete?

Réponse acceptée

Matt J
Matt J le 10 Oct 2018
Modifié(e) : Matt J le 10 Oct 2018
Using a nested Output Function, you can store freely to variables in the calling workspace like in this example.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Optimization Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by