Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Function-Call generator does not accept Simulink Parameter

1 回表示 (過去 30 日間)
Vamsinag Gunti
Vamsinag Gunti 2019 年 2 月 6 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi Community,
I am using the Value of a Simulink Parameter as the sample time in the function-call generator. However, I am getting the following error:
Error evaluating parameter 'sample time' in 'MyModel/Function-Call Generator'
Caused by:
  • Struct contents reference from a non-struct array object.
For the sample time I use the value of a simulink parameter:
mySimulinkParameter =
Parameter with properties:
Value: 0.0020
CoderInfo: [1×1 Simulink.CoderInfo]
Description: ''
DataType: 'single'
Min: 0.0010
Max: 1
Unit: ''
Complexity: 'real'
Dimensions: [1 1]
I.e, I enter
mySimulinkParameter.Value
as the sample time. However I get the error that I mentioned above. Could someone please explain this error to me?
Thanks in advance.
Best Regards,
Vamsi

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2019 年 2 月 6 日
It's a parameter so spescify the sample time as mySimulinkParameter.
  2 件のコメント
Vamsinag Gunti
Vamsinag Gunti 2019 年 2 月 6 日
編集済み: Vamsinag Gunti 2019 年 2 月 6 日
That was the first thing I tried. The block didn't accept the Simulink Parameter. This is the error I get:
Error reported by S-function 'fnccallgen' in 'MyModel/Function-Call Generator': Invalid sample time. Sample time must be a real scalar value or an array of two real values.
Fangjun Jiang
Fangjun Jiang 2019 年 2 月 6 日
編集済み: Fangjun Jiang 2019 年 2 月 6 日
It looks like changing the data type from 'single' to be 'auto' or 'double' will eliminate the error. Worth to repor this to the Mathworks. The error does not make sense.

この質問は閉じられています。

タグ

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by