audioplayer TimerFcn behavior when busy

3 ビュー (過去 30 日間)
Guillaume
Guillaume 2023 年 2 月 23 日
コメント済み: Mario Malic 2023 年 3 月 15 日
Hello there. Does an audioplayer object have an option to cancel calls of TimerFcn when system busy ?
(Like "BusyAction" for graphic objects or "BusyMode" for timer objects)
  5 件のコメント
Jan
Jan 2023 年 2 月 24 日
@Guillaume: Which behaviour do you want to achieve?
Mario Malic
Mario Malic 2023 年 2 月 24 日
編集済み: Mario Malic 2023 年 2 月 24 日
One thing that may be possible, however I am not sure how it would affect the performance of the compiled app. When you use plot, you add line objects, instead you could alter the XData and the YData of the first plotted line object. Example is below
function PlotDataAvailable(src, event)
[data, timestamps, ~] = read(src, src.ScansAvailableFcnCount, "OutputFormat", "Matrix");
persistent init fig ax hPlot;
if isempty(init)
init = true;
fig = figure();
ax = axes(fig);
end
if isempty(hPlot)
hPlot = plot(ax, timestamps, data);
else
hold(ax, "on");
set(hPlot, "XData", [hPlot.XData, timestamps'], "YData", [hPlot.YData, data'])
end
end
Otherwise, you should find a way to debug the compiled application, and figure out why does it happen.

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

採用された回答

Guillaume
Guillaume 2023 年 3 月 15 日
Thank you gentlemen for your suggestions. It helped a bit but the main problem is how the application goes slow once compiled.
Therefore I'm closing this topic which is in the end not addressing the main issue. I might open a new one to find guidelines to spot what makes a compiled app slow.
  3 件のコメント
Guillaume
Guillaume 2023 年 3 月 15 日
Do you have some guidelines or reference document to log such data from a compiled app ?
Mario Malic
Mario Malic 2023 年 3 月 15 日
Use diary to save the output of the command windows to a file. Output the needed data to the command window.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by