uitable not showing Data after deploying it with application compiler

Hello everyone,
My app designed in guide works fine in MATLAB without any error messages.
However, as soon as I compile the app with the application compiler to a standalone version, the uitable's are no longer displayed correctly. The rows and columns are transferred so that the correct number is displayed. However, this is empty for the user.
The table is filled normally via the 'Data' property (handles.uitable5.Data = celltable;).
This excerpt is the app when you start it from MATLAB (i.e. working correctly)
This is what the table looks like when it is started after compiling (regardless of whether it is a test version, installed, etc.):
Thank you for your help!

5 Comments

Hi,
to troubleshoot the problem, can you save celltable to a .mat file in the deployed app and see on a machine with MATLAB if the contents of the .mat file are correct?
Also in case you have not done so yet, try starting the executable from a console rather than double-clicking it to ensure that you see any error messages which in MATLAB would be printed in the Command Window.
Best wishes,
Harald
Hello Harald,
Thank you for your reply. I have now created a debug variable to see if the table really contains the values as suggested.
The table in the handle is completely correct and has the values that should actually be displayed. So it must be a render problem, where unfortunately the drawnow command doesn't help either.
If you have any other ideas for solving the problem, please let me know!
Best regards
Hi,
have you tried drawnow after updating the table?
If there is no resolution in this thread, please also consider contacting Technical Support.
Best wishes,
Harald
Hi Harald,
thanks for asking.
I solved the problem by converting the program written in guide to App Designer.
Guide apparently had a bug in the compiler, which is a pity, as I find guide a much more successful and better variant than app designer
Best regards
Hi,
my apologies, I didn't realize that you were using GUIDE.
To me, it's mostly what you are used to. If somebody is used to GUIDE (including its shortcomings), they may not find it desirable to switch to a new environment. In my opinion, the advantages of App Designer definitely prevail.
If there are specific reasons why you prefer GUIDE, please let MathWorks know. There may be strategies to addressing those reasons, or they might even have been addressed in more current releases.
If it's more of a matter of getting used to App Designer, you may find the App Building Onramp helpful.
Please also note that as mentioned in the doc, GUIDE will be removed in a future release. For more information, please see the "Version History" section.
Best wishes,
Harald

Sign in to comment.

Answers (1)

It seems to be a rendering issue... perhaps MATLAB is performing multiple tasks simultaneously, which results in failing to trigger the update of the uitable objects on screen when their 'Value' property is changed. Are you opening this .MAT file at the startup of the app? If so, consider inserting a 'drawnow' command before reading the .MAT file.
See some options below, so you can try... :)
% Assuming that you are executing this within the startup function of your app,
% insert a drawnow command so that MATLAB can complete the rendering of the
% objects on the screen.
drawnow
% If it's not enough, you can create a local variable...
T = readtable("myTable.csv");
app.UITable.Data = T;
% Or you can change more than one Property of the uitable.
T = readtable("myTable.csv");
set(app.UITable, Data = T, ColumnName = T.Properties.VariableNames)

3 Comments

Hello Eric,
it is indeed, as you suspected, a render problem. The table has the values it is supposed to display. Unfortunately, the drawnow command does not help, nor does the temporary variable.
I have already tried a pause, which doesn't help either.
If you have any further ideas to solve the problem, please let me know!
Best regards
Can you share the app (or a sample version of the app)?

Sign in to comment.

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 8 Feb 2024

Edited:

on 29 Feb 2024

Community Treasure Hunt

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

Start Hunting!