Difference between ssGetInputPortRealSignal and ssGetInputPortRealSignalPtrs
3 次查看(过去 30 天)
显示 更早的评论
Hi there,
I coded a S-Function which works pretty good. This function has several inputports with one dimension and several moredimensional inputports. At the moment I'm using the macro ssGetInputPortRealSignalPtrs(S,i)[j] to get the value of an input. But today someone told me using the macro ssGetInputPortRealSignal(S,i) might be a better way to get the value of this signal because this has a higher performace.
Can somebody explain the main differences between those to macros and which one should be used? I only know so far that ssGetInputPortRealSignals requires time continuous signals which can be initialzed with the macro ssSetInputPortRequiredContiguous.
Thanks for your support in advance, CN
0 个评论
采纳的回答
Kaustubha Govind
2013-1-11
You are correct that "ssGetInputPortRealSignals requires time contiguous signals which can be initialzed with the macro ssSetInputPortRequiredContiguous."
ssGetInputPortRealSignalPtrs is used for signals that can be non-contiguous. Examples of a non-contiguous signal are a bus signal or a signal that is a result of MUX-ing together signals from multiple sources, and possible other types of composite signals (I'm not sure if all composite signals are non-contiguous).
2 个评论
Kaustubha Govind
2013-1-14
Christoph: I don't know enough about the performance comparison between the two functions, but it seems likely that ssGetInputPortRealSignal would be more efficient if you assuredly have contiguous signals. It is best to use ssSetInputPortRequiredContiguous to ensure contiguity.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!