Requesting message to user for importing data using GUI

2 views (last 30 days)
Hi,
I have results from many experiments. Each experiment has two data files (.dat and .xlsx). my problem each time I need to run my code to analyze data for different experiments I have to copy the (.dat and .xlsx)for that experiment to same folder of my application. Is there anyway to do that using GUI to get browsing windows to import data. So when anyone runs the code the application request from user to import that two files and then open GUI to import that files.
I mean I want when anyone run the code. He/she will get requesting message to upload these files and then open browsing windows to import that files using GUI.
Thanks

Accepted Answer

Walter Roberson
Walter Roberson on 16 Nov 2015
If MATLAB is running on the system that has the files stored, then see uigetfile() to allow the users to select the files to be processed. uigetfile() returns a file name and a directory; you can use fullfile() to put together the directory and file name in order to get a complete path for the file to read. xlsread() will accept such a full path. I do not know how you are reading the .dat file but it can probably accept a full path as well.
If MATLAB is being accessed through a web browser then you would need a different series of steps.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!