Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
uiputfile default path

Subject: uiputfile default path

From: Maxx Chatsko

Date: 13 Jul, 2010 17:40:20

Message: 1 of 4

Hello all,
   When using uiputfile the default path displayed in the dialog box is always the current path in Matlab. Is there any way to specify the path/folder displayed in the dialog box inside of the uiputfile command? Or do I have to use addpath and path etc?
       Thanks
       Maxx

Subject: uiputfile default path

From: us

Date: 13 Jul, 2010 18:23:20

Message: 2 of 4

"Maxx Chatsko" <chatskom@chemimage.com> wrote in message <i1i8e4$q5a$1@fred.mathworks.com>...
> Hello all,
> When using uiputfile the default path displayed in the dialog box is always the current path in Matlab. Is there any way to specify the path/folder displayed in the dialog box inside of the uiputfile command? Or do I have to use addpath and path etc?
> Thanks
> Maxx

one of the solutions
- add an abs path before the file ext spec...

     ftyp=which('unique'); % <- just a folder...
     ftyp=fileparts(ftyp); % <- path...
     ftyp=[ftyp,filesep,'*.m'];
     [fn,pn]=uiputfile(ftyp);

us

Subject: uiputfile default path

From: Maxx Chatsko

Date: 14 Jul, 2010 14:26:12

Message: 3 of 4

"us " <us@neurol.unizh.ch>
> one of the solutions
> - add an abs path before the file ext spec...
>
> ftyp=which('unique'); % <- just a folder...
> ftyp=fileparts(ftyp); % <- path...
> ftyp=[ftyp,filesep,'*.m'];
> [fn,pn]=uiputfile(ftyp);
>
> us

    How can I incorporate that into the following code? Or is there a better way now that I provided a more specific answer? :
[filename_edit,text_path,filterindex]=uiputfile({'*.spc','SPC File (*.spc)';...
                                      '*.*','All Files (*.*)'},'Save Spectra');
   ALSO, I have 3 checkboxes that will save 3 different types of spectra. I would like to incorporate the 3 different types on the end of the filename, but before the extension. Is there a way to do this with one dialog box or do I need 3 seperate dialog boxes?
   My spectra types are swir={'_swir'} fci={'_fci'} rci={'_rci'}. I used these with strcat before I added a dialog box and they worked fine.
       Thanks
       Maxx

Subject: uiputfile default path

From: Maxx Chatsko

Date: 14 Jul, 2010 15:09:04

Message: 4 of 4

> How can I incorporate that into the following code? Or is there a better way now that I provided a more specific answer? :
> [filename_edit,text_path,filterindex]=uiputfile({'*.spc','SPC File (*.spc)';...
> '*.*','All Files (*.*)'},'Save Spectra');
> ALSO, I have 3 checkboxes that will save 3 different types of spectra. I would like to incorporate the 3 different types on the end of the filename, but before the extension. Is there a way to do this with one dialog box or do I need 3 seperate dialog boxes?
> My spectra types are swir={'_swir'} fci={'_fci'} rci={'_rci'}. I used these with strcat before I added a dialog box and they worked fine.
> Thanks
> Maxx

   Adding the acquisition type to the filename is more important to me than setting the path/folder. Anyone?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us