App Designer UIAxes imagesc extremly slow. How can i plot it as axes or uiaxes from inside the app in an extra figure?

8 views (last 30 days)
Hi,
after finisihing my App Designer App and implementing the plotting of the recordings as last step, i noticed that plotting with 10 Frames per second is impossible. The whole app stucks and the plotting is extremly slow and jumps over frames. After googling i found a subject about this issue in this forum. Now after creating the app in app designer this information is to late.
Now i tried to do it with uiaxes or normal axes. But both solutions doesn't work in App designer. App designer always wants UIAxes as handle.
First this is the loop for iterating over the frames:
for i=1:app.numTotalFrames
app.rdMapImage.XData = app.velocity_ticks;
app.rdMapImage.YData = app.range_ticks;
app.rdMapImage.CData = abs(app.rdMap(:,:,i)');
pause(app.framePeriod);
drawnow limitrate
end
This works but is not useable, because the performance ist very very bad. Not even 2 fps...
%Prebuild UIAxes with first Frame
app.rdMapImage = imagesc(app.UIAxes,app.velocity_ticks,app.range_ticks,abs(app.rdMap(:,:,1)'));
cBar = colorbar(app.UIAxes);
cBar.Label.String = "Normalized Power";
cBar.LimitsMode = 'manual';
cBar.Limits = [0 1];
title(app.UIAxes,'Range-Doppler-Heatmap');
xlim(app.UIAxes,[app.velocity_ticks(1) app.velocity_ticks(end)]);
ylim(app.UIAxes,[0 app.range_ticks(end)]);
ylabel(app.UIAxes,'Range [m]');
xlabel(app.UIAxes,'Velocity [m/s]');
I tried this with uiaxes and axes but imagesc wants UIAxes as container...
%Prebuild UIAxes with first Frame
app.fig = uifigure;
app.ax = uiaxes(fig);
app.rdMapImage = imagesc(app.ax,app.velocity_ticks,app.range_ticks,abs(app.rdMap(:,:,1)'));
cBar = colorbar(app.ax);
cBar.Label.String = "Normalized Power";
cBar.LimitsMode = 'manual';
cBar.Limits = [0 1];
title(app.ax,'Range-Doppler-Heatmap');
xlim(app.ax,[app.velocity_ticks(1) app.velocity_ticks(end)]);
ylim(app.ax,[0 app.range_ticks(end)]);
ylabel(app.ax,'Range [m]');
xlabel(app.ax,'Velocity [m/s]');
Now is there a posibillity that i can still use this app, with the performance of plotting it in a m-file. It's absolutely disappointing..
Thanks.

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by