Problem based framework for my optimization problem is not working

5 次查看(过去 30 天)
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 中查找有关 Problem-Based Optimization Setup 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by