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

6 次查看(过去 30 天)
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.

请先登录,再进行评论。

回答(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