Quantcast
Viewing all articles
Browse latest Browse all 130

supply lookup table to constraint function

I am using the fmincon solver to optimize some settings (more on that here (problem solved): https://www.mathworks.com/matlabcentral/newsreader/view_thread/339915#932558). The optimization takes too much time and therefore I am trying to speed things up. I think I have used all the easy tricks, so I have turned my attention to speeding up my custom functions. Some of them use a lookup table generated from an Excel-file and I realized the 'xlsread' and associated functions take 1.5 - 2 seconds to execute so it would be a good gain if I could get rid of it. Now these functions are all called within the nonlinear constraint function of the optimization so here is my question: Can I supply 2D-tables to the nonlinear constraint function which then relays them to my custom functions? And if yes, how? I think I can at least put the xlsread into the constraint function, but I would want to try
to only call it once before the optimization starts. Is this possible?

Viewing all articles
Browse latest Browse all 130

Trending Articles