workspaceの値をGAで使用したい

6 vues (au cours des 30 derniers jours)
fumito ito
fumito ito le 24 Jan 2017
Commenté : michio le 25 Jan 2017
以下に示すような式を遺伝的アルゴリズム(GA)で最適化したいです.以下に示す式のqはワークスペースに定義されている値を使うつもりでしたが,GAを実行すると 「関数または変数 'q' が未定義です。」 とエラーが出ます.ワークスペースの値を使うことはできないのでしょうか.ちなみにqはsimulinkのモデルから出力された1×11の行列です.
  3 commentaires
fumito ito
fumito ito le 25 Jan 2017
Modifié(e) : fumito ito le 25 Jan 2017
sim('GArensyu2');
[X,Y]=ga(@GArensyu5,11)
初心者なので変かもしれませんが,'GArensyu2'というsimulinkモデルをまわして,そのモデルによって出力されたデータを先ほど図に示したqの値として使いたいです.
fumito ito
fumito ito le 25 Jan 2017
のコマンドは最初の写真にありますが一応ここにもコマンドを載せておきます.
function trqdata=GArensyu5(x,q)
K=100
trq=K*(x-q)*0.1
trqdata=sum(trq)

Connectez-vous pour commenter.

Réponse acceptée

michio
michio le 24 Jan 2017
こちらのページが参考になるかと思います。
  3 commentaires
fumito ito
fumito ito le 25 Jan 2017
うまくいきました.助かりました. 本当にありがとうございます.
michio
michio le 25 Jan 2017
よかったです。他にもお困りの事があれば投稿してみてください。
また、回答のAcceptもよろしくお願いします。

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by