So I am trying to get a textfile onto matlab and define a matrix. I copied and pasted it onto the current folder in the name window next to the command window. In the command I put A=dlmread('file') but it keeps on giving me a cannot find file.
4 次查看(过去 30 天)
显示 更早的评论
A=dlmread('file') Error using dlmread (line 62) The file 'channel_AVG_Gly_3.5ul_min_particlt_.5ul_min_01.txt' could not be opened because: No such file or directory
0 个评论
回答(1 个)
Marc Jakobi
2016-10-10
编辑:Marc Jakobi
2016-10-10
Try this:
pathname = 'path\to\file'; %path to the file
filename = 'file.txt'; %don't forget the file extension (.txt)
A = dlmread(fullfile(pathname,filename));
or
pathname = pwd;
filename = 'file.txt';
A = dlmread(fullfile(pathname,filename));
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!