Graph doesn't update until I hit a breakpoint or pause

Hi,
Running into a strange issue. I'm using MATLAB app designer to record data coming from a serial port at a high rate (500-1000Hz) and as part of my program, I am plotting onto a a graph after running the data through a filter. While it seems reasonable that the rate of update would be slower after running it through the filter, what appears to be happening is that the graph isn't being updated at all. However, if I set a breakpoint in the program, the graph WILL update. Am I doing something wrong?
Thanks.
EDIT: I'm running the following code in a forever loop. The code is run if there is less data in the serial port than I collect per loop iteration, so it should update if updating won't cause the buffer to fill up.

 採用された回答

the cyclist
the cyclist 2023 年 4 月 20 日

0 投票

You can use the drawnow function to force figure updates and pending callbacks.

1 件のコメント

Nick Li
Nick Li 2023 年 4 月 20 日
Thank you, this did the trick.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

リリース

R2021b

質問済み:

2023 年 4 月 20 日

コメント済み:

2023 年 4 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by