Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Open multiple files with uigetfile?

217 views
Skip to first unread message

Marcelo Soto Thompson

unread,
Dec 13, 2000, 8:16:58 AM12/13/00
to
Hi everyone,

Is there a way of selecting and opening many files with the uigetfile (or
similar)???

As a workaround I've tried to make a "minibrowser" using listdlg to list the
files and directories in a directory but:
It it possible to have Matlab know which are files and which are
directories?

tnx
/M

---------
%minibrowser
ok=-1;
while ok ~= 0
d = dir;
wdir=['''' pwd ''''];
str = {d.name};
[selected,ok] = listdlg('PromptString',['Files in ', pwd], 'Name','Select
multiple files:',...
'SelectionMode','multiple','ListString',str);
if ok == 1
if isempty(findstr('.',char(str(selected(1)))))==1 %Does the
file name contain a dot ~= directory!
directory=['''' char(str(selected(1))) '''']
%Add '' in case the dir.name contains a spacechar.
eval(['cd ', directory]);
%Change directory to 'directory'
elseif (selected(1) == 1) | (selected(1) == 2)
cd ..
else
ok=0;
end
end
end
-------------

--
*****************************************************************
Marcelo Soto Thompson, MSc Eng.Phys., PhD-student
Atomic Physics, Dept. of Physics, Lund Institute of Technology
P.O. Box 118, SE-221 00, Lund, Sweden

Phone:+46-46-222 82 22 Cell:+46-702-77 20 98
Fax:+46-46-222 31 77 www-atom.fysik.lth.se :-D
*****************************************************************


Alex Knight

unread,
Dec 13, 2000, 10:17:28 AM12/13/00
to
Hi Marcelo.

Marcelo Soto Thompson wrote:

> Hi everyone,
> Is there a way of selecting and opening many files with the uigetfile (or
> similar)???

This is quite a common question! If you search the archives of the group, or
look at user contributed m-files at Mathworks' web site, I believe you will find
several ways of doing it.

> As a workaround I've tried to make a "minibrowser" using listdlg to list the

That's a reasonable approach - especially if you are building your own GUI.

> files and directories in a directory but:
> It it possible to have Matlab know which are files and which are
> directories?

The isdir field of the structure returned by the dir command contains this
information.

HTH

Alex
--
Alex Knight http://motility.york.ac.uk:85/

Ghassan Hamarneh

unread,
Dec 13, 2000, 10:13:11 AM12/13/00
to

"Marcelo Soto Thompson" <mar...@fysik.lth.se> wrote in message
news:917spo$1cn$1...@news.lth.se...

> It it possible to have Matlab know which are files and which are
> directories?

see help DIR
d=dir(...) return a structure with a 'isdir' field: d.isdir

HTH
Ghassan

Michael Robbins

unread,
Dec 13, 2000, 12:13:48 PM12/13/00
to

> > As a workaround I've tried to make a "minibrowser" using listdlg to
> > list the
> That's a reasonable approach - especially if you are building your own
> GUI.

Soon I will need to select multiple files. I like uigetfile, but it
doesn't allow ctrl-mouseclick or shift-mouseclick selection.

I intend to use an ActiveX control. It should be very simple to
implement.


BTW, TMW really should get this working. Their controls lag those of
the
Windows OS, and probably many others.

--
Michael Robbins, CFA
Director, Debt Capital Markets
Canadian Imperial Bank of Commerce, World Markets
New York


Sent via Deja.com
http://www.deja.com/

Michael

unread,
Dec 13, 2000, 6:06:17 PM12/13/00
to
Hi,
I got a mex file (wintel variety) called uigetfiles from someone on this
group (or possibly TMW website) cant remember which but im thinking TMW that
does this very well. It allows shift and ctrl selecting of multiple files
Mic


Michael Robbins wrote:

--
Michael Crump
Postgraduate Researcher / PhD Candidate
Sir Lawrence Wackett Centre for Aerospace Design Technology
Department of Aerospace Engineering
RMIT University
GPO Box 2476V
Melbourne, Vic 3001
AUSTRALIA

Ph: +61 3 9647 3089
Fax: +61 3 9647 3050


Marcelo Soto Thompson

unread,
Dec 14, 2000, 7:45:02 AM12/14/00
to
Hi,
Hmm, I found it (uigetfiles.dll) on mathworks website today (didn't
yesterday...)

Sorry to have taken your time. Tnx anyway.

/M

"Michael" <s940...@student.rmit.edu.au> wrote in message
news:3A3800E9...@student.rmit.edu.au...

0 new messages