現在この提出コンテンツをフォロー中です。
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます
This code increases the speed of the xlswrite function when used in loops or multiple times. The problem with the original function is that it opens and closes the Excel server every time the function is used. To increase the speed I have just edited the original function by removing the server open and close function from the xlswrite function and moved them outside of the function. To use this first run the following code which opens the activex server and checks to see if the file already exists (creates if it doesnt):
Excel = actxserver ('Excel.Application');
File='C:\YourFileFolder\FileName';
if ~exist(File,'file')
ExcelWorkbook = Excel.workbooks.Add;
ExcelWorkbook.SaveAs(File,1);
ExcelWorkbook.Close(false);
end
invoke(Excel.Workbooks,'Open',File);
Then run the new xlswrite1 function as many times as needed or in a loop (for example xlswrite1(File,data,location). Then run the following code to close the activex server:
invoke(Excel.ActiveWorkbook,'Save');
Excel.Quit
Excel.delete
clear Excel
This works exactly like the original xlswrite function, only many many times faster.
引用
Matt Swartz (2026). xlswrite1 (https://jp.mathworks.com/matlabcentral/fileexchange/10465-xlswrite1), MATLAB Central File Exchange. に取得済み.
一般的な情報
- バージョン 1.0.0.0 (3.24 KB)
-
ライセンスがありません
MATLAB リリースの互換性
- すべてのリリースと互換性あり
プラットフォームの互換性
- Windows
- macOS
- Linux
| バージョン | 公開済み | リリース ノート | Action |
|---|---|---|---|
| 1.0.0.0 |
