Tags: comgt, filter, ltsb_ji, matlab, path, pinpress, programming, remember, specfilenameuigetfile, temp, titus, todaysummary, uigetfile, yahoo

start path of uigetfile, remember last path

On Programmer » Matlab

3,389 words with 3 Comments; publish: Mon, 12 May 2008 11:06:00 GMT; (20046.88, « »)

Hi,

just add the path for the filter spec:

filename=uigetfile('c:\temp\*.*')

Titus

"Pinpress" <sb_ji.matlab.todaysummary.com.yahoo.com> schrieb im Newsbeitrag

news:ef46ef9.-1.matlab.todaysummary.com.webcrossing.raydaftYaTP...

> 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.

All Comments

Leave a comment...

  • 3 Comments
    • 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 wrote:

      >

      > Hi,

      > just add the path for the filter spec:

      > filename=uigetfile('c:\temp\*.*')

      > Titus

      > "Pinpress" <sb_ji.matlab.todaysummary.com.yahoo.com> schrieb im Newsbeitrag

      > news:ef46ef9.-1.matlab.todaysummary.com.webcrossing.raydaftYaTP...

      > point.

      > but

      >

      >

      #1; Mon, 12 May 2008 11:08:00 GMT
    • 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_ji.matlab.todaysummary.com.yahoo.com> schrieb im Newsbeitrag

      news:ef46ef9.1.matlab.todaysummary.com.webcrossing.raydaftYaTP...

      > 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 wrote:

      #2; Mon, 12 May 2008 11:09:00 GMT
    • It seems working. thanks.

      Titus Edelhofer wrote:

      >

      > 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

      #3; Mon, 12 May 2008 11:10:00 GMT