Pulling information from main script or function to constraint

조회 수: 1(최근 30일)
ew1124 2018년 11월 14일
편집: ew1124 2018년 11월 14일
I am interested in solving an optimization problem with MATLAB's gamultiobj function. I have built the function with the options I need. But each problem needs to have a different constraint, which I have saved externally.
I have a separate constraint function that I call. But I don't see how I can include this data in my constraint function. On the other hand I have also built an initial population, and I can use "options" as an input to the function, which gives me a way to pass the data being read in the main function to the population generation function.
How can I do this with the constraint function?
Example: minimize x = p*n
s.t. n * s > y
But for each problem I run, y is different. I have the y values in an external data file.


Community Treasure Hunt

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

Start Hunting!

Translated by