How can I xlswrite to a new line in an excel file?

11 ビュー (過去 30 日間)
Dr. ARK
Dr. ARK 2015 年 5 月 20 日
コメント済み: Dr. ARK 2015 年 5 月 20 日
I want to write an array to a new line in my excel document instead of overwriting previous lines in my excel document. Is there a way to do that? I just want it to jump a line. Note( I don't know what line I want it to write to, I just want the code to find the previous line in the excel doc and them simply write to the next one)

採用された回答

Abhiram Bhanuprakash
Abhiram Bhanuprakash 2015 年 5 月 20 日
Hello Dr. ARK,
I see two approaches to solve this issue:
1. You can use xlsread to read in the existing data in the Excel file into MATLAB, append the data to the existing data, and then overwrite the entire data using xlswrite.
But, this is a costly approach if you have to do this too many times, because this would involve launching and shutting down Excel each time you use xlswrite.
You can go for ActiveX commands, but this would require you to learn usage of these commands, and the whole purpose of using MATLAB would be defeated.
Check related threads:
2. You can go for this file submission 'XLSAPPEND' on MATLAB Central:
The authors of that file claim that it REQUIRES ONLY ONE CALL TO THE EXCEL ACTXSERVER, so the overhead is less than for successive xlsread/xlswrite calls.
Hope this helps,
Cheers!
Abhiram.
  1 件のコメント
Dr. ARK
Dr. ARK 2015 年 5 月 20 日
Thank you so much Abhiram! Greatly appreciated.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by