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.
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