How write multiple data output in excel sheet
3 次查看(过去 30 天)
显示 更早的评论
Hi All I want to get data from a serial port and stored in Excel sheet and i repeated this several times. but Every time a new value replaces in the previous value. but i need all the data. How do I store this data in a different sheet or file(Dynamic File Name). Regards
0 个评论
采纳的回答
Image Analyst
2013-2-26
Have you looked up xlswrite() and seen how the arguments let you specify the sheet or the cell to write to?
2 个评论
Image Analyst
2013-2-26
That tells me that you have not read the documentation, which says:
xlswrite(filename,A,sheet,xlRange) writes to the specified sheet and range, xlRange.
See the third argument, sheet? That is the name of the sheet. You could use 'This sheet' or 'That sheet' or 'Results' or 'Data' or whatever you want.
See the third argument, range? If you specify 'D42', it will put the upper left part of your array at cell D42, not A1.
If you don't specify the sheet, and don't use ActiveX, then it will blow away all prior contents on the first sheet. So if you want to keep those, then you need to use xlsread() to read in the current contents, and add your new data to that cell array, or else specify a different sheet.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!