Unable to load many files at once

조회 수: 3 (최근 30일)
Jorrit M
Jorrit M 2011년 9월 19일
Hi,
I've created a small video-editor using the matlab GUIDE. One of its functions is to load image files in order to convert them into a movie. Everything works fine, except that I cannot load more files than ~650 at the same time. Since I work with thousands of images, loading everything in batches of 600 is just annoying, and I figure I should be able to load all my files at once. I use the following code:
[cellFiles,pathvar] = uigetfile(...
filterSpec,...
'Pick a file','MultiSelect','on');
I guess the problem is that there is a limit to the size uigetfile can return, so I was wondering if anyone knows a way to circumvent this.
With kind regards, Jorrit Montijn
  댓글 수: 3
Jorrit M
Jorrit M 2011년 9월 20일
I've got matlab version 7.11.0 (R2010b). I don't get an error message at the command window, but only a pop-up message stating:
pxyt01_t00654
File not found.
Please verify the correct file name was given.
Since there is no file with such a name in that directory, but there is a file with the name pxyt01_t00654_ch01.tif, I think the filenames are read in as a single string with delimiters between the files, and the string variable runs out of space around the 1308th file (654 times two, because I have two channels per frame). It's probably not that surprising that a variable can run out of space after 1308*(22 (file length) + 3 (two " around the file and a single space between files))= 32000+ characters. But still, it's annoying. I guess I could ask users to supply the first and last frames and load all files in-between as well, but that limits the loading functionality (you can't skip certain frames while loading).
Anyway, since there is not even a real matlab error, but a GUI window showing the message I'm afraid the problem lies with some hardcoded string limit that cannot be changed programmatically. However, any imputs are appreciated!
Jan
Jan 2011년 9월 20일
Which OS do you use?

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2011년 9월 20일
There is an undocumented function called "native_uigetfile" in Matlab 2009a under Windows. Is it available on your system and does it influence the problem?
Another idea is FEX: uipickfiles.
  댓글 수: 5
Maya Aviv
Maya Aviv 2013년 2월 12일
did you find a solution? since i have the same problem. i have to get more than 1000 files.
Jan
Jan 2013년 2월 12일
@Maya Aviv: Which OS do you use?

댓글을 달려면 로그인하십시오.


Sean de Wolski
Sean de Wolski 2013년 2월 12일
Are you making sure to close the files when you are done with them? This is very important. The number of file handles is limited by the OS (i.e. not MATLAB) and if you open more than this you will see some of the most ridiculous behavior ever.
What is the output from:
hOpen = fopen('all');
This will tell you if you are not closing files when done with them. To close them use:
fclose(fid);
To close all of them:
fclose('all');

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by