error : "Argument to dynamic structure reference must evaluate to a valid field name" using Genetic Algorithms

Hi,
I am using a genetic algorithm to minimize the single output of a decision tree, which I succesfully trained previously, for just one of the inputs. And i get the error : "Argument to dynamic structure reference must evaluate to a valid field name". And I don't know what I am doing wrong.
Thanks for your help.
Find attached the code:
%Define Constants
ds=5;
v=100;
optDT = zeros(length(ds),length(v));
fvalDT = zeros(length(ds),length(v));
for q = 1:length(ds)
for t = 1:length(v)
FitnessfunDT = @(y) modelfunT(y,ds(q),v(t),net);
[optDT(q,t),fvalDT(q,t)] = ga(FitnessfunDT,1,[],[],[],[],1,60,[],1);
end
end
%%%%%%
function berDT = modelfunT(y,ds,v,tree)
berDT = tree.predict([y,ds,v]);
end

1 件のコメント

Geoff Hayes
Geoff Hayes 2017 年 7 月 12 日
Guillem - where has net been defined?

回答 (0 件)

この質問は閉じられています。

質問済み:

2017 年 7 月 12 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by