OK, I called tech support and they were able to replicate the problem once. But that was enough to show them that there was a problem. The work around to resolve the issue was to do a 'clear all' on the Matlab main window before I run the app.
Newbie Table Array and UITable question
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
The GUI was made using App Designer. The following code, I create and initialize the property InstrumentTable at the same time and then set app.UITable.Data = app.InstrumentTable and got InstrumentaTable to show in the GUI. This is what I wanted.
properties (Access = private)
InstrumentTable = table("test", "HP1", 0, 0)
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
%app.InstrumentTable = table("test", "HP1", 0, 0)
app.UITable.Data = app.InstrumentTable
end
end
However, when I initialize InstrumentTable in the startupFcn of the app I just get a blank table: Here is the code
properties (Access = private)
InstrumentTable
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
app.InstrumentTable = table("test", "HP1", 0, 0)
app.UITable.Data = app.InstrumentTable
end
end
Here is the result
Can someone explain to this newbie what is going on?
Respuestas (2)
Bhargavi Maganuru
el 11 de Sept. de 2019
properties (Access = private)
InstrumentTable
end
% Callbacks that handle component events
methods (Access = private)
% Code that executes after component creation
function startupFcn(app)
app.InstrumentTable = table("test", "HP1", 0, 0)
app.UITable.Data = app.InstrumentTable
end
end
This code is working fine, and output is getting as expected (table values are displayed).
In properties section, you can create custom properties for data that is shared between different parts of app and it doesn’t matter where you initialize the property.
Hope this helps!
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!