フィルターのクリア

Does matlab become slow and unusable when working in a folder with many files?

9 ビュー (過去 30 日間)
Christopher
Christopher 2015 年 10 月 23 日
回答済み: Steven Lord 2015 年 10 月 23 日
Matlab has recently become incredibly slow and virtually unusable recently. Particulary, functions such as
importdata(sprintf('model%d.mat', curmodel));
and
filexists = exist(checkfile, 'file');
are taking hundreds of times longer than it should, even though all of the files imported and checked are less than 100 kb.
I suspect that this is because I am working in a folder which has about 50000 files. In addition, even if I am not using such functions many other aspects of matlab are still pretty much unusable. For example, it takes minutes for basic variable names to show up in the workspace. Importing a 50 kb file into the workspace takes about 3 minutes. No, nothing else is bogging down the system.
Has anyone else noticed this bug? Can it be fixed or is there a workaround?
  3 件のコメント
Christopher
Christopher 2015 年 10 月 23 日
Local HD.
dpb
dpb 2015 年 10 月 23 日
Which OS, ML release? Windows/MSDOS at least used to be very susceptible to the issue of larger subdirectories taking inordinate amounts of time. I've not kept up with the status recently.
I'd suggest proving the issue by moving a few of the files to another working directory and ensure the symptoms do go away.

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

回答 (2 件)

Ken Atwell
Ken Atwell 2015 年 10 月 23 日
When you cd into a folder with 50,000 file, bear in mind that all of these files are visible from MATLAB path, and therefore must be inspected and cataloged. I would avoid this situation. Keep your MATLAB code files in reasonably-sized folders. Keep your thousands of data files in a folder that you never cd to (no addpath either). You will need to name your path when you use importdata et al (see below), but that is a small price to pay to avoid drowning MATLAB in thousands of extra (and mostly worthless) names to keep track of.
importdata(sprintf('data_folder\model%d.mat', curmodel));

Steven Lord
Steven Lord 2015 年 10 月 23 日
In addition to what others have said, do you have the Current Folder Browser open when you navigate into the directory that contains so many files? If so, try closing that window before navigating into that directory if you don't need to use the Browser.

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by