How to centre UITABLE in a figure? How to get the uitable reference?
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I have 2 questions
1)
I am defining the full screen size of the figure using
f = figure('units','normalized','outerposition',[0 0 0.95 0.8]);
and then defining an uitable. is there direct way I can centre the UITABLE into the defined figure. I can try using the position property and with trail and error i can find the centre position. Is there any other way to do this.
2)
How to get the address of each cell data in a uitable, If I have a 4x4 matrix how to get the reference of 2x2 cell (2nd row, 2nd column).
Appreciate your help
Regards
Karthiik
0 个评论
采纳的回答
Walter Roberson
2012-6-25
1) There is no direct way to center a uitable.
You can use Normalized units for the uitable position and give the position in a symmetric way, [X Y 1-X 1-Y]
If you know the size of the table you want in pixels, then you can get() the Position of the containing figure and calculate the position that leaves equal margins on the two sides. As you created the figure with normalized units, you will need to temporarily change the figure units to Pixels, get() the Position, and switch the figure units back to normalized.
2) No mechanism is provided for determining the screen location of a particular cell in a uitable (though you might be able to do something at the Java level.) The cells also do not have individual handles. The only official access you have to the cells is to get() the Data property of the uitable, which will return a cell array.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!