MATLAB: Is there a way to avoid scrollbars in an uitable

scrollbarsuitable

Hi, I like to print some specific values beside a plot in an uitable und save it to a pdf. My uitable always creates scrollbars, so if I open the pdf I'm not able to see all values because I cannot scroll the bars anymore. I'm wondering if there is an option I can set to avoid the scrollbars and always get the fullsize of the uitable on my figure? Thanks for helping!

Best Answer

I got an answer from matlab support and I want to share the solution with you: You can try to resize the uitable manually to its fullsize. When you define a uitable object it includes a property called 'Extent' which tells you exactly the size the table would need to have for it to come without scrollbars. After refering to the following example, I got the right behaviour:
f = figure; t = uitable(f,'Data',randi(100,10,3),'Position',[20 20 262 100]); t.Position(3:4) = t.Extent(3:4);