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 Center および File ExchangeNonlinear Optimization についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by