From: B. Schmidt on
Is there a way to write uitable data to a tab delimited text file?
From: B. Schmidt on
"B. Schmidt" <bschmidt0123(a)gmail.com> wrote in message <i3p8vm$gsq$1(a)fred.mathworks.com>...
> Is there a way to write uitable data to a tab delimited text file?

I have answered my own question:

I was stubornly trying to use the DLMWRITE function for writing a tab delimited text file, to no avail. I then found the FPRINTF fucntion which allows the user to specify the contents and formats of a mixed cell array like the one that my table data consists of (i.e. numbers and strings). For those that may also need to do this in the future here is the code I used:

%my table has four columns (float, float, float, string) and 15 rows
tabledata = get(handles.tblOptimize,'data');
filename = ['outputdata.txt'];
fid = fopen(filename, 'w');
for i = 1:15
fprintf(fid, '%5.4f\t %5.4f\t %5.4f\t %s\r\n', tabledata{i,:});
end
fclose(fid);
From: us on
"B. Schmidt"
> filename = ['outputdata.txt'];

you don't need those brackets...

filename='outputdata.txt';
% will do...

us