Problem using field of structure parameter as constant block value.

조회 수: 1 (최근 30일)
John
John 2017년 11월 10일
댓글: John 2017년 11월 13일
After creating a structure parameter like this:
FTIP = Simulink.Signal;
FTIP.CoderInfo.StorageClass = 'ExportedGlobal';
FTIP.DataType = 'Bus: FTIPBus';
FTIP.Complexity = 'Real';
FTIP.Dimensions = 1;
FTIP.DimensionsMode = 'Fixed';
FTIP.SamplingMode = 'Sample based';
FTIP.InitialValue = 'FTIPStruct';
I can display a field in the matlab command window like this:
FTIP_Param.Value.Gain1
ans = 10
But when I use the same 'FTIP_Param.Value.Gain1' as the value of a constant block I get the error: 'Structure field Value not found'

답변 (1개)

Mark McBroom
Mark McBroom 2017년 11월 12일
You didn't state this, but I assume that RTIP_Param is a Simulink.Parameter? If so, try using RTIP_Param.Gain1. In this case, the "Value" is not needed when accessing the data object.
  댓글 수: 1
John
John 2017년 11월 13일
Yes, sorry I included the wrong definition example (I had tried using a Simulink.Signal originally). I did create FTIP_Param as a Simulink.Parameter and then I set the 'Value' to a structure (FTIPStruct). And I did try accessing it in the constant block as FTIP_Param.Gain1 with no luck.

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by