shows table in gui panel
3 views (last 30 days)
Show older comments
polo Mahmoud
on 17 Feb 2020
Commented: Diego Guisasola Plejo
on 6 Dec 2020
Hi
I have made this code to show my table in gui, but the table just pops up and does not show in the gui application
handles.T = table((1:(size(nCoord,1)-1))',x_globalx(:,1),x_globay(:,1),x_globarz(:,1), 'VariableNames',VarNames)
fig = uifigure;
uit = uitable(fig, 'Data',handles.T);
set(handles.uitable1, 'Data', handles.T); ( this is the one i think i have made wrong )
4 Comments
Adam Danz
on 18 Feb 2020
"Yes I use GUI"
There are several ways to make a GUI in Matlab. I'm asking specificlly if you've used the guide() method. Based on your variable names, I think this is the case.
"...but it did not work"
I don't know what that means. Did you get an error message(if yes, please share the entire copy-pasted error message)? Did the table data no appear? Did something else happen unexpectedly?
Accepted Answer
Adam Danz
on 18 Feb 2020
"Error using matlab.ui.control.Table/set; Functionality not supported with figures created with the figure function."
handles.T should be a cell array instead of a table. You can either create the cell array directly instead of creating a table, or you can convert the table to a cell array using table2cell().
Then you can use
set(handles.uitable1, 'Data', handles.T);
% cell array ^^^^^^^^^
3 Comments
Diego Guisasola Plejo
on 6 Dec 2020
Thank you so much, I've been trying to solve this for the past 2 hours and it was a datatype problem. Thanks!
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!