Simulink model error: Brace indexing is not supported for variables of this type.

조회 수: 2 (최근 30일)
Dave Hall
Dave Hall 2021년 7월 30일
댓글: Dave Hall 2021년 8월 2일
I'm not sure why I'm getting this error with Simulink. I thought perhaps it was related to "local" vs. "scoped" variables (local having [] and scoped {}), but that doesn't appear to be the case. One challenge is that the Diagnostic Viewer doesn't give me a link to where in the model the error comes from, and the only description is: Brace indexing is not supported for variables of this type.

답변 (1개)

Shadaab Siddiqie
Shadaab Siddiqie 2021년 8월 2일
From my understanding you are getting an error in your Simulink. This error message may stem from an uncaught syntax error in your reference design plugin file (plugin_rd.m). For example, if the 'CustomConstraints' property of the hdlcoder.referencedesign class is specified as a char array:
hRD.CustomConstraints = 'myConstraints.xdc';
instead of a cell array:
hRD.CustomConstraints = {'myConstraints.xdc'};
Starting from R2020a, validation for this property was added, so it will now properly error out. You can see this by running the following code in the latest release:
>> hRD = ZedBoard.vivado_base_2018_1.plugin_rd;
>> hRD.validateReferenceDesign;
which will error out with the message:
Invalid property value for property "CustomConstraints".
Value must be a cell array of character vectors, for example, hRD.CustomConstraints = {'abc.xyz'}.
  댓글 수: 2
Dave Hall
Dave Hall 2021년 8월 2일
Thanks, @Shadaab Siddiqie. I will look further, but so far, I don't see any places where I've coded character arrays vs. cell arrays and I don't appear to be using plugin_rd anywhere. In fact, this was a small Simulink code that was working previously and mysteriously started producing this error. I'm in the process of re-writing the code to see if that avoids the problem. Very frustrating, though.
Also, I tried running it under 2021a to see if that gave me better error checking, but I got the same "Brace indexing is not supported for variables of this type." error with no link.
Dave Hall
Dave Hall 2021년 8월 2일
@Shadaab Siddiqie, quick update: I re-wrote the module, and the problem has disappeared. Not sure what this error was, but I've avoided it for now. Moving on. Thanks for your help.

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

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by