フィルターのクリア

Simulink scope not updating smoothly when usng Simulation Pace block

21 ビュー (過去 30 日間)
ScubaNinjaDog
ScubaNinjaDog 2023 年 2 月 14 日
編集済み: ScubaNinjaDog 2023 年 2 月 24 日
I have a Simulink model of a toy spring-mass-damper system. I am using the Simulation Pace block and the Pilot Joystick All block. The joystick represents the forcing function u(t). When I run the simulation, the scope does not update every second (or which ever pace I set). Instead the rate at which the simulink scope updates is erratic. Sometimes it updates after 2 seconds, sometimes after 10 seconds. I had this issue before but I fixed it by reinstalling Matlab. I'm thinking this likely restored a specific setting to a default. Which setting might this be?

回答 (1 件)

Anshuman
Anshuman 2023 年 2 月 21 日
If you go the scope window, go to View -> Configuration Property -> Time tab, and there you will find ‘Time Span’ and ‘Time display offset’ settings, which you can set accordingly. Now if you run the simulation, the scope block starts recording values from ‘Time display offset’ time and continues to record for ‘Time span’ amount of time. For example, if you set the Time display offset to 10 and the Time span to 5, the scope will display the values from T=10 to T=15.
When you reinstalled MATLAB, maybe these settings were restored to default.
Hope it helps!
  1 件のコメント
ScubaNinjaDog
ScubaNinjaDog 2023 年 2 月 24 日
編集済み: ScubaNinjaDog 2023 年 2 月 24 日
I don't think this is the issue. This problem happens regardless of what value the time span and time display offset values are. The problem is the the plotted lines on the scope do not update according to the step time. What happens when I run is that the plotted lines will start updating (by this I mean literally drawing the lines on the scope) but then freeze for a couple of seconds, and then start updating again. This happens randomly. On my laptop, when I run the same simulink file, the lines plot out very smoothly over time (no periodic freezing), but I have the same scope parameters set. I wish there was a way I could record it in a GIF and upload it to make it clearer.
An analogy would be if you are watching a movie, and it freezes at a single frame for a couple of seconds, then starts playing again, but skipping over the frames during that time frame when it was frozen.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by