struct contents reference from a non-struct array object [Help Please]

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;

답변 (1개)

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

Thank you Walter Roberson , i will try it
the same error, but when i use dbstop if error , the error shown in Parallel cause i'm using parallel processing , so how to solve it ?
Put this line before the error and tell us what shows in the command window:
whos Child
To go beyond that we would need to see the code.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2017년 6월 7일

댓글:

2017년 6월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by