How to write string and numerical data to an excel file.
Afficher commentaires plus anciens
Dear Sir/Madam,
I have a issue of saving mixed data to an excel file. The following is my code:
Title = {'CameraSN' 'BenchTime' 'GrayLevel' 'Mean' 'MAX' 'MIN' 'Particles' 'DetectTime'};
Output = [Title; CamFolder, BenchID, num2cell(G), num2cell(M), num2cell(MAX), num2cell(MIN), num2cell(N), num2cell(Time)];
xlswrite(strcat(OutFilePath,OutputFileName), Output);
Notes:
- "CameraSN" and "BenchID" are cell arrays
- The length of each element of each cell in these cell arrays is 8 and 32 respectively.
The code works fine, all data are saved expect the colum of "BenchID" is empty. However, if using "xlswrite('test9.xls', BenchID{1})", the data can be saved properly.
Could you help me figure out what happened when I saved all data at the same time into a spreadsheet?
Best regards, Tracy
Réponses (1)
Tracy
le 21 Fév 2013
0 votes
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!