Requesting message to user for importing data using GUI
1 view (last 30 days)
Show older comments
Ali Kareem
on 16 Nov 2015
Answered: Walter Roberson
on 16 Nov 2015
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
0 Comments
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!