gaに関して発生したerrorについて
Afficher commentaires plus anciens
simulinkで構築したモデルの姿勢の最適化をするためにgaを使おうとしたら,以下のようなエラーが発生しました.
エラー: ga (line 393)
関数への入力引数にコロン演算子が含まれています。コロン演算子を入力するには、代わりに ':' を使用してください。
エラー: Gatry2 (line 16)
[X,Y]=ga(ObjectiveFunction,16,A,b,Aeq,beq,lb,ub,nonliner,ConstraintFunction,options);
このエラーの原因がどの部分で,どう書くのが正しいのか知りたいです.
以下が私の書いたgaのプログラムです.
sim('seniorCar1205ga');
ObjectiveFunction = @gatry; %gatry:gaで最小を求めたい関数プログラム
nvars = 16; % Number of variables
ConstraintFunction = @gatry;
lb=[0.1358 0.0997 -0.7927 -0.3667 -0.4854 -0.2115 -0.2137 -0.2013 -0.2418 -0.2096 -0.2701 -0.2798 -0.2188 -0.2144 -0.2045 -0.200005];
ub=[0.5358 0.4997 -0.3927 0.1667 -0.2854 0.2115 0.2137 0.2013 0.2418 0.2096 0.2701 0.2798 0.2188 0.2144 0.2045 0.200005];
A=[];
b=[];
Aeq=[];
beq=[];
nonliner=[];
options=optimoptions('ga','PopulationSize',24,'generations',40,'Display','iter','EliteCount',1,'PlotFcns',{@gaplotbestf},'UseParallel',true);
[X,Y]=ga(ObjectiveFunction,16,A,b,Aeq,beq,lb,ub,nonliner,ConstraintFunction,options);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur パフォーマンスの手動最適化 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!