Problem based framework for my optimization problem is not working

조회 수: 3 (최근 30일)
Satyajit Ghosh
Satyajit Ghosh 2021년 10월 25일
편집: Satyajit Ghosh 2021년 10월 25일
At first, I was performing an optimization with respect to all elements of 'A' matrix using below command.
[Aopt,fopt]=fminunc(@(A)myObjective(A,N33,p1,v,limit,n),A0,options);
But now I want an extra parameter (x) to be used for optimization also. Hence, I switched to problem based framework implemented using below code segment.
A=optimvar('A',N,3);
x=optimvar('x',1);
fun=fcn2optimexpr(@(A,x)myObjective(A,x,N33,p1,v,limit,n),A,x);
sol0.A=... %initial A0
sol0.x=... %initial x0
sol=solve(optimproblem('Objective',fun),sol0,options);
But, it is not working. I am getting error like this.
Error using optim.internal.problemdef.ProblemImpl/solveImpl
Expected a string scalar or character vector for the parameter name
Error in optim.problemdef.OptimizationProblem/solve
Error in Optimization_FINAL.m (line 145)
sol=solve(optimproblem('Objective',fun),sol0,options);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by