App Designer is slow to plot
18 次查看(过去 30 天)
显示 更早的评论
App Designer is slow to plot
Good evening, yesterday I was making a program in the extension "App Designer" of MatLab more specifically in version R2020a of this.
The application I designed, aims to represent a non-linear regressions and therefore requires to show a graph, and display similar information in a table. What happens is that my computer takes too long to display this information, specifically when rendering the results; I know this because I placed a point to debug the procedure just before the data is printed. This allows us to conclude that the program's delay is only when it should plot the results and print data in the table.
Also attach a button to clean up the results and the procedure to clean up the graph and clear the table too late.
I have run the procedure on several computers with various technical specifications and none of them are as late as mine.
My specifications are:
Ryzen 3 3200g 3.6 GHz - 4.0 GHz 4 cores - 4 wires
NVIDIA GeForce 1650 Super MSI
8 GB RAM 3200
I attach images about the app designer model and the code that graphics.
fill(app.UIAxes,Z,ZY,[199, 199, 199 ]./255)
hold(app.UIAxes,'on')
scatter(app.UIAxes,X(:,1),Y,30,[15, 100, 89]./255,'filled')
plot(app.UIAxes,Xcal(:,1),Ycal,'Color',[ 1, 75, 213]./255)
legend(app.UIAxes,'Banda del ajuste','Experimental','Ajuste','location','best','interpreter','latex')
ylabel(app.UIAxes,'Variable dependiente','fontsize',17,'interpreter','latex')
xlabel(app.UIAxes,'Varibale independiente','fontsize',17,'interpreter','latex')
axis(app.UIAxes,'tight')
grid(app.UIAxes,'on')
app.UITable.Data = S;
Similarly attached is the code to clean the graph and delete the table
cla(app.UIAxes)
app.UITable.Data = [];
To be more demanding with the subject of specifications I have made the "bench" test and obviously in computers with worse results than those obtained by him the graph is plotted much faster.
I would like to know how to solve this problem, if it is some interference between my hardware or some kind of optimization in the app designer (I have tried with different codes and the program has plotted normally and quickly); in the worst case I have a problem with the specifications of my equipment.
3 个评论
Mohammad Sami
2020-11-25
It will be difficult to make the builtin functions faster.
What you can do add a drawnow command before the setting Data on uitable.
That should make atleast the plot appear.
回答(1 个)
Aiswarya Subramanian
2020-12-8
Dear Jorge,
UIAxes uses a different rendering engine than classic Axes. Reducing the size of the UIaxes could possibly improve the performance (work with lesser number of datapoints, e.g. by downsampling the data before calling any plot command). The performance depends on the number of pixels that that we have to render, so a smaller size means better frame rates.
Hope this helps!
-Aiswarya
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!