Difference between ssGetInputPortRealSignal and ssGetInput​PortRealSi​gnalPtrs

조회 수: 5 (최근 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

채택된 답변

Kaustubha Govind
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
Christoph
Christoph 2013년 1월 11일
Thanks for your support and pointing out the difference between contigous and continuous. Am I right using the macro ssGetInputPortRealSignal is the best why fastest way to get onedimensional real signals but won't work with more dimensional(muxed) signals.
with kind regards, CN
Kaustubha Govind
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 CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by