Effacer les filtres
Effacer les filtres

Using GUI to saving/loading directory.

4 vues (au cours des 30 derniers jours)
ZK
ZK le 5 Fév 2013
Hi, I have a question.
I'm writing a scripts that converts data files, after that I'm converting them to exe files using deploytool.
Can I add to them a GUI interface, that would choose a loading and saving directory on hard drive?
Thanks.

Réponses (2)

John Petersen
John Petersen le 5 Fév 2013
Put this in your callback
[filedat,pathdat] = uigetfile('*.dat','Select a Data File');
Then you can import the file and do what you want with it.
  4 commentaires
Jan
Jan le 6 Fév 2013
@ZK: Use absolute file names in fopen(), when the files are in another folder. fullfile() creates such names. A more general idea: always using absolute filenames avoids problems of unexpected changes of the current folder, e.g. from a GUI or TIMER callback.
UIGETDIR searches for folders, therefore you cannot specify, which kind of files you are searching for. Please explain, what you actually want to do.
ZK
ZK le 6 Fév 2013
Thank You, I understands now. I'm using
A = dir(uigetdir('C:\','Select directory of a files'));
What can I use instead of fullfife() to load only files like example '*.a'?

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 6 Fév 2013
Sure. You can use something like MAGIC to list your files in a listbox to make it convenient for your users to specify files.

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by