Plotting fmincon with varying constraint
古いコメントを表示
Hi all. I've got a function which I'm trying to minimize subject to a nonlinear constraint. I've been able to get this to work, but now I want to vary the constraint and plot the minimum as a function of this new parameter. I.e., I want to plot
subject to the constraint
The parameter a should take values in
. I can provide the files I'm working with upon request, but so far I've just been working with fmincon as provided in the documentation. Any advice is appreciated, thanks in advance!
subject to the constraint 採用された回答
その他の回答 (1 件)
John D'Errico
2022 年 12 月 30 日
編集済み: John D'Errico
2022 年 12 月 30 日
0 投票
You already know how to use fmincon. And surely you understand how to use a for loop.
- Set up a loop, varying a over the indicated domain.
- Call fmincon with the current value of a in the constraint, saving the results into a vector.
- After the loop has terminated, plot the results as a function of a.
Don't just provide the files, then asking us to write the complete code to solve your problem. Surely you can do exactly what I just explained in that basic algorithm. If then you have a problem, show what you tried. Explain where you are confused.
カテゴリ
ヘルプ センター および File Exchange で Choose a Solver についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!