How do you transfer numeric data to an excel file?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The following code is what i used to try to transfer data from the file passReport.EO1_2013_107_193146 to the excel file EO1_2013_107_193146.xlsx
However, my code failed. Any suggestions on how i can transfer the numeric data will be greatly appreciated.
Code:
*fileID = fopen('passReport.EO1_2013_107_193146');*
*c = textscan(fileID, '%s')*
*fclose(fileID);*
*filename = 'EO1_2013_107_193146.xlsx';*
*caC = {c}; % Stick string into a single cell.*
*xlswrite(filename, caC, 'A1');*
0 Kommentare
Antworten (1)
Evan
am 2 Jul. 2013
Bearbeitet: Evan
am 2 Jul. 2013
If you want to read in numeric data, use a specifier like %d, %f, etc. The documentation for textscan gives a full list: http://www.mathworks.com/help/matlab/ref/textscan.html
I replied to your previous question in a comment, but here is a modification to that comment for handling numeric data:
fid = fopen('test.txt'); %test.txt is a text file containing numbers 1:10
t = textscan(fid,'%d');
xlswrite('test.xlsx',t{:}); %data is written to excel cells A1:A10
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!