Is it possible to pass a parameter which represents the "sampleTime" at a 2-Level S-function?
古いコメントを表示
Is it possible to pass the sampleTime value as a parameter or an input into a S-function and to use this this value further in the S-function Outputs algorithm?
At the moment I programmed it in the following way: block.SampleTimes = [1e-3 0],
but I would like to have it like this: block.SampleTimes = [s_func_sample_time 0],
in order to specify the sample time somehow from outside of the S-function and to pass this value e.g. via the s_func_sample_time variable. Does there exist a possibility to do this either via the S-function parameter mask (block.NumDialogPrms) or via the S-function inputs (block.InputPort) or in any other way?
My aim is to use this parameter (s_func_sample_time value) further in the S-function Outputs function. E.g. in order to realize a discrete PI-controller. For the I-part it is necessary to know the sample time in order to integrate over the corret time interval. This sample time would be stored in the s_func_sample_time variable and I could use it in the Outputs algorithm.
1 件のコメント
TAB
2012 年 7 月 5 日
I deleted my answer as it was not relevant to your question.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Block and Blockset Authoring についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!