I am loading over 50,000 x 40 of mixed data type into a uitable. Obviously when loading this amount of data in a uitable the obvious choice is to use old uitable ('v0'). I understand it might be discontinued in the future releases but I am sure mathworks will first improve the performance of new uitable to atleast comparable before pulling the plug on 'v0'.
New uitable (which is much more flexible) takes care of the column width and headers height and width automatically and aesthetically. I am trying to replicate exactly that in old uitable, so far with mixed success.
1) I am trying to set table header height and able to do that. But the figure-uitable is not updated until I resize it with mouse. As soon as I drag one of the corners of the corners of figure the header height is updated. I would like to get it automatically updated as soon as the new value is set. How can I do that?
I have tried jtable.repaint, drawnow, refreshdata(with and without handle) but nothing seems to update the table with new header height.
2) Second problem is when I run this code in command windows it works fine. But when I run it as m-file it throw an error at me "Attempt to reference field of non-structure array." at theader.getParent.setPreferredSize(d). However when I define a break point at this line and try to debug it works absolutely fine. I must be doing something wrong.
Any help of this would be greatly appreciated. And sorry for asking two questions in one go.
Thanks.
cname={'<html><center /><body text=#C60000><strong>Date Time <br /> [Linked to Models]',...
'<html><centre/><body text=#C60000><strong>Quan1 <br /> [psia]',...
'<html><center/><strong>Pre-Status <br> Quan1',...
'<html><center /><strong>Post-Status <br/> Quan 1',...
'<html><center /><body text=#C60000><strong>Date Time <br /> [Linked to Models]'};
h_old=uitable('v0',...
'data',magic(5),...
'ColumnNames',cname,...
'position',[5,5,550,400]);
figure
h_new=uitable('data',magic(5),...
'ColumnName',cname,...
'position',[5,5,550,400],...
'Units','normalized');
set(h_old,'Units','normalized')
jtable=h_old.getTable;
theader=jtable.getTableHeader;
d=theader.getPreferredSize();
d.height=40;
theader.getParent.setPreferredSize(d)