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!