struct contents reference from a non-struct array object [Help Please]
Ältere Kommentare anzeigen
Hi everybody ,
Please i have an error occur in this statement the error is [struct contents reference from a non-struct array object] :
if(EndC)
NCover= max(Child.Chromosome); %//// <<<<<< here is an error
for S_i = 1 : length(LN)
SC = UselessSensors(S_i);
Child.Chromosome(SC) = NCover;
Flag(SC ) = 1;
end;
end;
Antworten (1)
Walter Roberson
am 7 Jun. 2017
At that point, your variable named Child is not a structure.
There is not much more we can say about the situation without more code.
You should use
dbstop if error
and then run your program. When it stops, look at size(Child) and class(Child) .
Pay attention to the possibility that you initialized
Child = [];
and then have code that you think should always assign a structure to Child: if for some reason it does not assign a structure to Child then you would encounter that error because Child would not be a structure.
4 Kommentare
Mustafa Nadhim
am 7 Jun. 2017
Mustafa Nadhim
am 8 Jun. 2017
Image Analyst
am 8 Jun. 2017
Put this line before the error and tell us what shows in the command window:
whos Child
Walter Roberson
am 8 Jun. 2017
To go beyond that we would need to see the code.
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!