append data in excel sheet

43 vues (au cours des 30 derniers jours)
Mahmoud Hassan
Mahmoud Hassan le 28 Sep 2018
Commenté : ANKUR KUMAR le 19 Mai 2020
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

Réponses (1)

ANKUR KUMAR
ANKUR KUMAR le 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 commentaires
AJEET KUMAR
AJEET KUMAR le 19 Mai 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
ANKUR KUMAR le 19 Mai 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?

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by