Using GUI to saving/loading directory.

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.

답변 (2개)

John Petersen
John Petersen 2013년 2월 5일

0 개 추천

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

ZK
ZK 2013년 2월 5일
Thanks, in free moment I will check it.
ZK
ZK 2013년 2월 6일
편집: ZK 2013년 2월 6일
Thanks it works. I had used similar function uigetdir.
I have few questions.
1. Why when I'am reding files from another folder, not saved in script directory I have -1 fid(after using fopen). This isn't hapening when I'm have files and script in the same category.
2. Can I add to uigetdir infromation what kind of files I'm searching?
Jan
Jan 2013년 2월 6일
@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.
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'?

댓글을 달려면 로그인하십시오.

Image Analyst
Image Analyst 2013년 2월 6일

0 개 추천

Sure. You can use something like MAGIC to list your files in a listbox to make it convenient for your users to specify files.

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

태그

질문:

ZK
2013년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by