Help with setting up an optimization problem
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have a question about setting up an optimization problem. I have a function that looks like this:
[ correlation ] = my_function ( input1, input2, input3, optParm )
My_function calls a bunch of different image processing sub routines that I've written and inputs 1, 2 and 3 are arrays of photos that need to be loaded into the function. The function basically processes 100 images and then compares the automatically measured results to the manually measured results. Anyway, I don't know if the details of my program really matter. I'm having trouble setting up the optimization portion of this.
This is what I have so far; most of which is taken from the help files:
options = optimoptions(@fminunc,'Algorithm','quasi-newton');
optParm0 = 10;
[optParm,fval,exitflag,output] = fminunc(@CP_Process_All,optParm0,options);
I want the optimizer to try all different values of optParm, starting with 10 and maximize the correlation. The error that I'm getting is "not enough input parameters". In all the examples, the objective function just has a single input value. I don't know how to set it up this way because my function needs the input arrays to run properly.
Any help would be greatly appreciated!
Thank you!
댓글 수: 0
채택된 답변
Alan Weiss
2014년 10월 13일
However, I wonder if you have a discrete problem, where your optParm has to be an integer. If so, then you cannot use Optimization Toolbox functions, because they require that the decision variable (unknown parameter) is a continuous one.
Alan Weiss
MATLAB mathematical toolbox documentation
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!