Prompt user to load data file
Show older comments
I am creating a pop-up menu as part of a final project for one of my courses. One option on this menu will ask the user to load a data file, I'm not sure how to ask a user which file they would like to use. I know how to load data files into arrays, but I don't know how to build a prompt that will ask "which file." Preferably I'd like it to open a file explorer in which you select a file, but I'm not sure if this is possible.
Here is what i have. The prompt to select a file to load into an array would be case 2.
choice = 1;
while choice ~= 11
choice = menu('Statistical Analysis','Set username','Load data file','Clear data','Set output filename','Plot histogram','Plot histogram fit','Plot probability plots','Regression of y on x','Find probability (x or z)','Find x or z','Exit')
switch choice
case 0
close all
case 1
username = input('Please input your username:\n','s')
case 2
x = load('input')
case 11
close all
end
end
Accepted Answer
More Answers (0)
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!