I got a question via e-mail that was asking how to set the data in a uitable.
Setting the data in a uitable is as easy as:
>> a = uitable
>> set(a,’data’, magic(3))
The important part of this video is seeing the thought process of discovering that.
When you programmatically create a uicontrol, or uitable, you should capture the handle to that widget, as I did with a. When you have that handle you can GET or SET the properties of the widget.
Good to have you back here, Doug. As you know, the MATLAB GUI Building doc now links to your archive, so keeps these tips and tricks coming!
Was this posting inspired by a user who had to ask how to get data into a uitable, even after checking the doc? If so, the MATLAB Graphics and GBT doc has utterly failed to communicate basic information.
Is this supposed to perform the same on R2007a running on Mac OSX?
This is what I get when I try to do the same things:
EDU>> close all
EDU>> clear all
EDU>> a = uitable
a =
javahandle_withcallbacks.com.mathworks.hg.peer.UitablePeer
EDU>> set(a,'data',magic(3))
??? Object belongs to an incompatible Java class.
EDU>>
In case anyone else found the same issue…
I went ahead and upgraded to R2008b (ver 7.7.0) and it works exactly as shown in the video. (Running on an Intel-Mac OSX)
These video tutorials are really helpful! Thanks Doug!
I am going to get a lot of use out of the uitable in the gui I’m writing.
Hi, may I know is it possible and how to arrange data in GUI table? I have few variables like a, b, c and d. Each of them have 10 rows of data. I wish to arrange them in the table format in GUI and make it a table of 4 column (a, b, c, d) and 10 rows in GUI. I try to use the command like set(handles.uitable1,’data’,a) and it can display 10 rows in first column of GUI table. But I fail to make it displays b in second column, c in third and d in fourth column. It seems like only can display one column. Thanks a lot.
how to prepare uitable to incrementally insert data into it.
like if i have data comming in serial port and i need to display in uitable, one row for each input data segment
how can i do that??
i even dont know how many number of rows i need to show at first..
what is the limit to for row and column in uitable??
I had the same issue a little while ago but on a windows xp with the R2007b, so I tcheck up and finaly see that it was because in this release the uitable function was not completly set and was powered by java, so in the subsequent version they improve it and drop the java part
Leave a Reply
About
Doug Hull is a proud MathWorker who is on a mission to help you with MATLAB.
Good to have you back here, Doug. As you know, the MATLAB GUI Building doc now links to your archive, so keeps these tips and tricks coming!
Was this posting inspired by a user who had to ask how to get data into a uitable, even after checking the doc? If so, the MATLAB Graphics and GBT doc has utterly failed to communicate basic information.
Is this supposed to perform the same on R2007a running on Mac OSX?
This is what I get when I try to do the same things:
In case anyone else found the same issue…
I went ahead and upgraded to R2008b (ver 7.7.0) and it works exactly as shown in the video. (Running on an Intel-Mac OSX)
These video tutorials are really helpful! Thanks Doug!
I am going to get a lot of use out of the uitable in the gui I’m writing.
Andrew,
Glad you were able to solve your own issue and help everyone else out in the same way.
Thanks,
Doug
Hi, may I know is it possible and how to arrange data in GUI table? I have few variables like a, b, c and d. Each of them have 10 rows of data. I wish to arrange them in the table format in GUI and make it a table of 4 column (a, b, c, d) and 10 rows in GUI. I try to use the command like set(handles.uitable1,’data’,a) and it can display 10 rows in first column of GUI table. But I fail to make it displays b in second column, c in third and d in fourth column. It seems like only can display one column. Thanks a lot.
@Sharon,
Make the entire matrix of data first then set it into the uitable.
Doug
how to prepare uitable to incrementally insert data into it.
like if i have data comming in serial port and i need to display in uitable, one row for each input data segment
how can i do that??
i even dont know how many number of rows i need to show at first..
what is the limit to for row and column in uitable??
thx n regards
ash
@Ashok,
See answer 6 above. You will have to just keep updating it as you see fit.
Doug
@Andrew
I had the same issue a little while ago but on a windows xp with the R2007b, so I tcheck up and finaly see that it was because in this release the uitable function was not completly set and was powered by java, so in the subsequent version they improve it and drop the java part