フィルターのクリア

GA optimasation error during the running , the subcript indices must be integer positive or logical?

2 ビュー (過去 30 日間)
i define my fiteness function for the GA using 'assignin' expression
function [y]=myfiteness(x)
assignin('base','na',x(1));
assignin('base','nb',x(2));
[~,~,Y]=sim('mymodel',[0,1]);
y=y(end,2);
after using otimtool for GA for the function , the running stops and a message apear in the running section of the optimtool which show the following ''the subcript indices must be integer positive or logical''
so how to solve this problem????????
  3 件のコメント
khelifa siham
khelifa siham 2022 年 5 月 8 日
thank you sir for your observation but in fact the variable is y, not Y as i wrote before, i made the mistake of writting while i was posting the question ,so there is variable to work with in the simulation.
Walter Roberson
Walter Roberson 2022 年 5 月 8 日
What happens if sim() returns an empty variable at that point?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePerformance and Memory についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by