RealTime Pacer能够放慢仿真时间,使得运行时间与真实的挂钟时间同步。
The RealTime Pacer block slows down (“paces”) simulation time so that it synchronizes with real elapsed time.
通过Speedup参数可以控制仿真时间的实际运行节奏。
The degree of slowdown is controllable via a Speedup parameter.
该模块使用M文件的S函数实现,可以支持任何Simulink平台,但不支持代码产生。
- The block is implemented using an M S-function, so it works on any supported Simulink platform. It does not support code generation.
该模块使用MATLAB PAUSE函数对仿真时间进行降速,PAUSE命令在暂停期间放弃对处理器的控制,因此系统性能不会下降。
- The block uses the MATLAB PAUSE function to slow down the simulation. The PAUSE command gives up the processor during the pause, so system performance does not degrade.
M-S函数描述了如何使用嵌套函数来简化代码设计。
- The M-S function illustrates how to use nested functions to simplify the code.
仿真时间和真实的实时时间之间的匹配是近似的,预期差异在10到30毫秒的量级。这种限制是由于多任务操作系统难以精确定时导致的。
The matching between simulation time and elapsed real time is approximate, with expected differences on the order of 10 to 30 milliseconds. This limitation is due to difficulties of precise timing with a multitasking operating system.
源码下载地址:
http://page5.dfpan.com/fs/1lc6j2d21829a165ac7/
更多精彩文章请关注微信号: