how i correct error in Matlab
이전 댓글 표시
I receice this error
Attempt to reference field of non-structure array
Error in perturb_method (line 136)
[j,k]=find(pop(i).mat.p==x)
댓글 수: 3
Rik
2021년 3월 10일
Clearly you read Jan's answer below (as you edited the question). Did his suggestion solve the issue?
dalel amami
2021년 3월 11일
Jan
2021년 3월 11일
I've explained already how to use the debugger to find out, what the cause of the error message is. If pop(i).mat is not a truct, you cannot access a not existing field p . Without seeing your code and the data, it is impossible to guess, what you want to do instead.
What does Matlab show you, when it stops at the error message in debug mode, for:
class(pop)
class(pop(i).mat)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Debugging and Improving Code에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!