error(message('MATLAB:csvread:FileNotFound'))
1 次查看(过去 30 天)
显示 更早的评论
I am trying to to import data into my script and I am getting the following message "error using csvread(line35) File not found" and line35 in the csvread.m script is stating 'error(message('MATLAB:csvread:FileNotFound'))'
0 个评论
回答(1 个)
Walter Roberson
2017-8-11
Well, that seems clear. You are asking to import a file that is not in your current directory and is not on your MATLAB path.
If you used something like uigetfile() to have the user select a file, or if you used dir() on a directory to find the file names, you probably forgot to add the directory name into the file name. For example,
[basename, filepath] = uigetfile('*.csv', 'Select a dataset');
if isnumeric(filename);
uiwait(msgbox('User cancelled'));
return
end
filename = fullfile(filepath, basename);
data = csvread(filename);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!