save dataset in a specific exel sheet
1 view (last 30 days)
Show older comments
hi everyone,
someone can tell me how can i save a dataset in a specific sheet from exel?
Thanks
0 Comments
Accepted Answer
Azzi Abdelmalek
on 8 Aug 2014
num = xlsread(filename,sheet)
2 Comments
Azzi Abdelmalek
on 11 Aug 2014
convert your dataset to cell then use xlswrite
M=dataset2cell(A) % A is your dataset
xlswrite('your_file.xlsx',M,sheet)
More Answers (1)
Image Analyst
on 8 Aug 2014
Edited: Image Analyst
on 8 Aug 2014
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 Comments
Image Analyst
on 11 Aug 2014
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?
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!