Question

I have multiple datasets that I wish to update to a single uitable. I have made both data tables as editable in uitable and I am extracting the changed data using data=get(hObject,'data') and writing back to workspace variables using assignin('base','well_pt_tags',data). My problems is:

1) I am managing to write back to workspace variables without any problem. However, re-initiating GUI does not uploads the updated data table (from the workspace) to uitable. It still loads the data it started with (the one I set in uitable 'Table Properties Editor' > 'Data' > 'Change data value to selected workspace variable'). How can I make it load the most up to date data from the workspace?

2) I am planning to have multiple push-buttons which will load data to a single uitable. How can I make the push button callbacks to load respective data to uitable.

I am using GUIDE to design my GUI.

Test Sample GUI: https://www.dropbox.com/s/xp6fl641ysle1ig/sample%20gui.png

I have checked for these issues extensively on the web but no avail. Any help would be appreciated.

Was it helpful?

Solution

If you have the handle of the uitable (here: myHandle), you can use:

set(myHandle,...
'Data', MyNewData);

with MyNewData as the updated data.

You can also use additional arguments, like:

...
'ColumnName', columnname,...
'ColumnFormat', columnformat,...
'ColumnEditable', columneditable,...
'ColumnWidth', 'auto',...
'RowName',names);

There are a lot more options, not all of them are documented. Have a look here to find out more about undocumented Matlab-features!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top