Filter löschen
Filter löschen

Setting Data in a GUI Table

18 Ansichten (letzte 30 Tage)
Patrick
Patrick am 5 Mär. 2015
Hi,
I've created a GUI in Matlab with 4 pushbuttons and a table. I want to set initial values in the table when the GUI opens, and then change the values in the table when one of the buttons is pressed.
I'm new to this, what do I need to do to set the data in my uiTable1? I feel like this should be easier then I'm making it. I don't want the user to be able to change the cells of the table, I just want to change the cells of the results from a code that I will run as a display.
Thanks,
  5 Kommentare
Patrick
Patrick am 5 Mär. 2015
I figured out my first problem with how to replace the first value. Now I need to figure out how to limit the number of concatentations and then return a popup window at the end
Brendan Hamm
Brendan Hamm am 5 Mär. 2015
Sure just place this in an if statement (checking the size of the 'Data'), make a new figure, and add a uitable or annotation('textbox',...) with the data.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Brendan Hamm
Brendan Hamm am 5 Mär. 2015
Use the set command:
f = figure;
d = randn(10,3); % Make some random data to add
t = uitable(f);
set(t,'Data',d); % Use the set command to change the uitable properties.
set(t,'ColumnName',{'a';'b';'c'})
  3 Kommentare
Brendan Hamm
Brendan Hamm am 11 Dez. 2016
Glad to hear this helped out. I'm a bit surprised to see how many views this one answer has ... must be a popular topic.
abdulghani aldhaibani
abdulghani aldhaibani am 26 Apr. 2018
thank you ... Brendan Hamm

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Yingcai
Yingcai am 1 Dez. 2016
Bearbeitet: Yingcai am 1 Dez. 2016
t = handles.uitable1;
d = randn(10,3); % Make some random data to add
set(t,'Data',d); % Use the set command to change the uitable properties.
set(t,'ColumnName',{'a';'b';'c'})
%yingcai1012@hotmail.com

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by