Why does MATLAB slow down with time?
조회 수: 12 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Debugging and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!