Hello.
I am using the following code below to copy the contents of a uitable.
s=get(handles.uitableResults,'data')size_s = size(s); str = sprintf('%s\t%s\t\%s\t\%s\t','Plane','FWHM', 'Enc.Energy','<loc Int>','Brenner');str = sprintf ( '%s\n', str );%str = '';
for i=1:size_s(1) for j=1:size_s(2) str = sprintf ( '%s%f\t', str, s(i,j) ); end str = sprintf ( '%s\n', str ); end clipboard ( 'copy', str );
I have hardcoded the titles (column headings), however I now use this code to copy many different populations of the uitable, each with a different number of columns and column headings. Can the above code be generalised to just pick up the current column names?
Thanks
Jason
Best Answer