Looking for optimization loop or tool

조회 수: 7 (최근 30일)
Tony Esposito
Tony Esposito 2015년 3월 29일
편집: Matt J 2015년 3월 31일
I'll preface this question noting that I'm new to Matlab and have only been using it for about a week now. I've written the program that I want, but now I need help with optimization.
My program takes (as input) a 1x16 row vector where each entry can vary between 0 and 1. The program then calculates a series of parameters based upon these 16 values.
What I would like to do, is to use some kind of optimization loop/tool that will vary the 1x16 input vector and allow me to specify specific parameters as restrictions (i.e. a < 0.01 ans b = 3500) and specify two other parameters as targets (i.e f = 85 and g = 100).
Is there a way to do this in Matlab? If the reader is familiar with Excel, I'm looking for something similar (but preferable more powerful than) Excels solver add-in.
Thank you in advance for your time.
  댓글 수: 1
Matt J
Matt J 2015년 3월 29일
b = 3500 is not really a "restriction". It means you already know its value!

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2015년 3월 29일
편집: Matt J 2015년 3월 30일
You can look at the Optimization Toolbox if you have it. Look at fmincon() or lsqnonlin() if your objective function is nonlinear.
  댓글 수: 2
Tony Esposito
Tony Esposito 2015년 3월 31일
My objective isn't a single function, which is what I was trying to describe above. My objective, I think, would be the "f" and "g" parameters that I indicated above, which are calculated within a script file.
Matt J
Matt J 2015년 3월 31일
편집: Matt J 2015년 3월 31일
lsqnonlin accepts a vector-valued objective, so in your case this could be [f(x);g(x)]. It tries to minimize the norm of this objective, which I assume is what Excel does as well.
If you really think you need fancier multi-objective optimization, then you might look at fgoalattain().

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by