Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Guillem Heinrich
Guillem Heinrich le 12 Juil 2017
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by