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

start path of uigetfile, remember last path

147 views
Skip to first unread message

Pinpress

unread,
Nov 27, 2006, 8:44:04 AM11/27/06
to
Hi,

Matlab uigetfile opens the current directory as the starting point.
How can we let it 'remember' the last place user has been?
'UIGETDIR' function has a starting path as an input parameter, but
uigetfile doesn’t seem to have one. Thanks.

Titus Edelhofer

unread,
Nov 27, 2006, 9:25:29 AM11/27/06
to
Hi,
just add the path for the filter spec:
filename=uigetfile('c:\temp\*.*')

Titus

"Pinpress" <sb...@yahoo.com> schrieb im Newsbeitrag
news:ef46e...@webcrossing.raydaftYaTP...

Pinpress

unread,
Nov 27, 2006, 9:36:08 AM11/27/06
to
That seems only work in the format you give, ie., you can't specify
any specific extension you want, etc. For example, if I need to do:

[filename, pathname] = uigetfile( ...
{'*.mat','Converted MAT Image pair (*.mat)'; ...
'*.img', 'Raw image file (*.img)'; ...
'*.bmp', 'Converted BMP image file (*.bmp)'}, ...
'Pick a snap image file (cam?_s*.img; cam?_s*.mat;
im_pair_*.mat');

If I change '*.mat' to: 'c:\tmp\*.mat', it does not work the way I
expect, instead, it still uses current path. any ideas?

Titus Edelhofer

unread,
Nov 27, 2006, 9:53:01 AM11/27/06
to
O.K., then use the last parameter (default file) for the directory:

[filename, pathname] = uigetfile( ...
{'*.mat','Converted MAT Image pair (*.mat)'; ...
'*.img', 'Raw image file (*.img)'; ...
'*.bmp', 'Converted BMP image file (*.bmp)'}, ...

'Pick a snap image file (cam?_s*.img; cam?_s*.mat; im_pair_*.mat',
'c:\temp\');

Titus

"Pinpress" <sb...@yahoo.com> schrieb im Newsbeitrag

news:ef46...@webcrossing.raydaftYaTP...

Pinpress

unread,
Nov 27, 2006, 4:56:16 PM11/27/06
to
It seems working. thanks.
0 new messages