フィルターのクリア

Why does MATLAB slow down with time?

9 ビュー (過去 30 日間)
Siddhant Chandra
Siddhant Chandra 2018 年 8 月 17 日
編集済み: Walter Roberson 2018 年 8 月 17 日
Hi
I am running a code, not so heavy I guess. Using a quad core processor. Clock speed 2.8GHz. 16GB RAM. Windows 10 64-bit OS. MATLAB version is slightly older (MATLAB 7.5.0 R2007b). I am not plotting any graphs. I have made sure that I clear all arrays before each loop begins. All I am doing in the code is to read through 1090 .csv files, sort the rows, and extract few top rows and write them in another Excel file in another folder. I am doing it in 14 'for' loops so I can get the Excel files as and when each of them gets ready. But I have observed that the execution time has increased from the time I had initially started to run my code. Any one who could give me tips to solve this?

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 8 月 17 日
編集済み: Walter Roberson 2018 年 8 月 17 日
As you are using Windows and an older version of MATLAB, we recommend that you switch from using xlswrite() to using the File Exchange contribution xlswrite1() which is more efficient. In some of the older releases around the time of yours, xlswrite() did not reliably release resources and so would slow down when it was called repeatedly.
If your code is repeatedly writing to the same file, then xlswrite1() will help, but better yet would be to create a cell array that you made all of the changes into and then only xlswrite1() the final version.

カテゴリ

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