How to write string and numerical data to an excel file.
이전 댓글 표시
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
답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!