Getting error: Function 'subsindex' is not defined for values of class 'struct'.

조회 수: 6 (최근 30일)
Centauri Jolene
Centauri Jolene 2019년 4월 15일
댓글: Centauri Jolene 2019년 4월 15일
I'm trying to run the following code,
lv2_data(structIndx_lv2).pairNum = pairNum;
but keep getting this error:
Function 'subsindex' is not defined for values of class 'struct'.
When I debug the code and stop it at this line, I can confirm that
lv2_data is an empty structure array (initialized as lvl2_data = struct;)
structIndx_lv2 = 1
pairNum = 10
When I run this same line in debug mode, it works perfectly fine. I cant figure out what is going on here.
  댓글 수: 2
Matt J
Matt J 2019년 4월 15일
편집: Matt J 2019년 4월 15일
When I run this same line in debug mode, it works perfectly fine.
If that's the case, then I deduce that you have not entered debug mode through
>> dbstop if error
I would do that and re-run the code.
Centauri Jolene
Centauri Jolene 2019년 4월 15일
Thanks, that has shown me another error with my code that I couldnt see before.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by