programming a user response for a prompt
Show older comments
Hi all,
I was wondering if there was a way to write some matlab syntax that can respond to a prompt for user input. When I used this code:
[filename, directory_name] = uigetfile('*.dat', 'example_file.dat');
fullname = fullfile(directory_name, filename);
data = readcell(fullname);
I get prompted to specify the exact file I want to import into matlab:

(I've blacked out some portions for security reasons)
I wanted to know if there was a way to write some matlab syntax to choose the right file for me, assuming I give the full name of the .dat file I want, in this case, a real file named:
example_file.dat
essentially, I want to declare a newfile name variable within the command window, run my script and have it automatically write data into a file without any user input.
Thanks in advance.
Accepted Answer
More Answers (0)
Categories
Find more on App Building 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!