How write multiple data output in excel sheet
3 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Image Analyst
on 26 Feb 2013
Have you looked up xlswrite() and seen how the arguments let you specify the sheet or the cell to write to?
2 Comments
Image Analyst
on 26 Feb 2013
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.
More Answers (0)
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!