save dataset in a specific exel sheet
1 次查看(过去 30 天)
显示 更早的评论
hi everyone,
someone can tell me how can i save a dataset in a specific sheet from exel?
Thanks
0 个评论
采纳的回答
Azzi Abdelmalek
2014-8-8
num = xlsread(filename,sheet)
2 个评论
Azzi Abdelmalek
2014-8-11
convert your dataset to cell then use xlswrite
M=dataset2cell(A) % A is your dataset
xlswrite('your_file.xlsx',M,sheet)
更多回答(1 个)
Image Analyst
2014-8-8
编辑:Image Analyst
2014-8-8
Your wording is contradictory ("save from excel"). Not sure if you mean read from Excel or save to Excel, so I'll give both cases:
To retrieve a dataset from Excel ( into MATLAB), use
[numbers, textCells, rawCells] = xlsread(fullFileName, sheetname);
To save a dataset in a specific sheet to Excel ( from MATLAB to Excel)?
xlswrite(fullFileName, data, 'A1', sheetname);
3 个评论
Image Analyst
2014-8-11
xlsread() does not send/export data from MATLAB to Excel. That's what xlswrite() does. Is there any reason why you think you must use export() instead of xlswrite() like Azzi showed you?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!