How do you allow a user to input a .csv file?
14 views (last 30 days)
Show older comments
What command is used to allow a user to input a .csv file, also how is the command formatted? Many thanks!
2 Comments
Answers (1)
KL
on 15 Oct 2017
Edited: KL
on 16 Oct 2017
If you want to import data from this file,
data = csvread('yourfilename.csv')
if you want user to pick the file using a dialog box, then
[fileName, pathName] = uigetfile('*.csv');
data = csvread(fullfile(pathName,fileName)) ;
4 Comments
Walter Roberson
on 16 Oct 2017
Note that we recommend against using a variable named "path", as "path" is the name that MATLAB uses to manage how to find files.
See Also
Categories
Find more on Workspace Variables and MAT Files 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!