Getting/Setting Sampling Time of S-Function (Level 2)

조회 수: 3 (최근 30일)
SeungHwan Jo
SeungHwan Jo 2017년 3월 9일
편집: SeungHwan Jo 2017년 4월 3일
I'm having trouble with getting sampling time of S-Function(Level 2). Documentation says there's some way to set-up sampling time but, it's mostly about it's type(discrete, inherited, continuous...). Especially, Continous(inf), But I need sampling time in my simulation and even it says continuous, It must have sampling time since it's computer. So question is how to get/set sampling time of continuous sampling S-function.
  댓글 수: 2
Michelle Wu
Michelle Wu 2017년 3월 13일
Your best reference for understanding the S-Function sample time would still be the following two docs:
which I think you probably have came across already.
Unfortunately for a system to be continuous, its sample time has to be 0. It is not a limitation posed by Simulink or S-Function, but one posed by the theory behind the concept of sampling: for a continuous system, the frequency has to be infinite and the sample time is thus 0.
If you would like to have a small sample time (like a high frequency CPU), then the proper choice is probably "discrete" with a very small sample rate.
SeungHwan Jo
SeungHwan Jo 2017년 4월 3일
편집: SeungHwan Jo 2017년 4월 3일
Thank you for the answer. Yes, I know about the continuous concept, but I don't think MATLAB/Simulink works that way cause it imposes very high load to CPU and does not coincide with Simulink itself's sampling time concept.
I was doing simple collision processing in Level 2 S-Function. And I just could be able to find out that sampling time of continuous function coincide with 3~5 times of Simulink timestep. But, I want something solid.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by