matlab linspec,Inspect Simulink Desktop Real-Time™ Signals with Simulation Data Inspector - MATLAB &...

This example shows how to use the Simulation Data Inspector (SDI) to log signal data from the real-time application. Use Simulink® external mode to establish a communication channel between your Simulink® block diagram and your real-time application. Control which signals to display by selecting them in the model. You can log signal data from models referenced at arbitrary levels within a model hierarchy.

This example uses the model sldrtex_model. To open this example, in the MATLAB Command Window, type:

open_system(docpath(fullfile(docroot, 'toolbox', 'sldrt', 'examples', 'sldrtex_model')))

Open sldrtex_model.

In the Simulink Editor, on the Simulation tab, set the simulation stop time to, for example, 30 seconds.

In the model, select the signals Signal Generator and Transfer Fcn.

On the Desktop Real-Time tab, click Log Signals. A faint Simulation Data Inspector icon appears next to each signal.

To start the real-time execution in external mode, on the Desktop Real-Time tab, click Run in Real Time. The Simulation Data Inspector button glows, indicating that Simulation Data Inspector has data available for viewing.

On the Desktop Real-Time tab, click Data Inspector.

In the Simulation Data Inspector, select the signals SignalGenerator:1 and Transfer Fcn:1. Simulation Data Inspector displays plotted data.

203852f17c382d3766ba7b4351a42633.png

10. To stop the simulation, click the Stop button.

11. After the simulation, use the toolbar buttons to explore the data. For example, to view the simulation between seconds 2 and 4, in Simulation Data Inspector, click the Zoom in Time button. Drag the cursor over the range from 2 to 4.

7838c9cd09d7193fda46e7f46deb2d50.png

12. To save the Simulation Data Inspector session as a .mat file, click Save.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值