From: B. Schmidt on 9 Aug 2010 12:05 Is there a way to write uitable data to a tab delimited text file?
From: B. Schmidt on 9 Aug 2010 15:55 "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 9 Aug 2010 17:22 "B. Schmidt" > filename = ['outputdata.txt']; you don't need those brackets... filename='outputdata.txt'; % will do... us
|
Pages: 1 Prev: different folder reads Next: remove a specific frequency from emg signal |