append data in excel sheet
13 views (last 30 days)
Show older comments
I want to append date and i want all these date in the same row ... also i want to know how to append another data in the row next automatically each time ... pls help
0 Comments
Answers (1)
ANKUR KUMAR
on 28 Sep 2018
Just write the cell name at the time of using xlswrite
A=rand(6,12)+10 %random data
xlswrite('sample.xlsx',A,'sheet name','A1')
% now you already have file names sample.xlsx in which data is spreaded
% upto A1 to L6. Now suppose you wish to append in first row after L column
xlswrite('sample.xlsx',[2,5,8,9,6,3,5],'sheet name','M1')
%first row of xlsx file have columns upto R and remaing have still up to M
%now, suppose you want to add down of the complete written data
xlswrite('sample.xlsx',magic(5),'sheet name','A8')
2 Comments
AJEET KUMAR
on 19 May 2020
Actually, we don't want to specify the cell number to put the data.
Can i do something, where the new data gets appended after the data which is available in the Excel data?
ANKUR KUMAR
on 19 May 2020
Yes, you can do. It can be done easily by reading the number of rows in the above command, and then use that number to generate the cell number.
By default, MATLAB prints the matrix starting from cell numer 'A1'.
"... after the data which is available in the Excel data?" Is the already available data written from the other source (like downloaded from internet), or already available data has been written by you through MATLAB?
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!