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

8 vues (au cours des 30 derniers jours)
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.

Réponses (1)

Abhishek Chakram
Abhishek Chakram le 3 Oct 2023
Hi Kaan Inal.
It is my understanding that you want to plot the data in uiaxes or axes from inside the app in an external figure. You can use “uifigure” for that. Here’s a sample code for that:
fig = uifigure;
ax = uiaxes(fig);
x = 1:10;
y = 1:10;
plot(ax,x,y);
You can refer to the following documentation to know more about the functions used:
Best Regards,
Abhishek Chakram

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by