How to call an external function in linprog optimization
Ältere Kommentare anzeigen
Hi,
i want to run a simple and fast optimization example. My problem is the calculating of values in an external function. Example: x1 is the input value (in the range of 1 to 5) of a function called 'Master' x2 will be the output matrix of the function 'Master', which should be less or equal than 0.5 in each cell
1<=x1<=5
x2<=0.5
So i wrote
A = [1 0
-1 0
0 0.5
];
b = [5;-1;1];
Aeq = [1 0 %x1=inputvalue
0 1]; %x2=Master(x1)
beq = [ input
Master(input)
];
x=linprog(f,intcon,A,b,Aeq,beq);
After running this, there is the error: Undefined function or variable 'input'. Error in line ... beq=[input
How can i perform the optimization?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Solver Outputs and Iterative Display finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!