Why "File not found"?

조회 수: 9 (최근 30일)
Matlaber
Matlaber 2019년 2월 13일
댓글: Matlaber 2019년 2월 14일
I am trying to follow the example of csvread here
filename = 'csvlist.dat';
M = csvread(filename)
I have csvlist.dat file save in my matlab directory.
>> M = csvread('csvlist.dat')
Error using csvread (line 35)
File not found.
I need to import my data, but which to select?
Capture.PNG
Thank you
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 2월 13일
I wonder if there is a hidden character? Try
dinfo = dir('*.dat');
filename = {dinfo.name};
fprintf('found file named "%s"\n', filename);
fprintf('The representation of that is: \n');
disp(0 + filename);
and show us the output.
If the output is something different than
99 115 118 108 105 115 116 46 100 97 116
then you might have unusual characters in the name.
Matlaber
Matlaber 2019년 2월 14일
Thanks.
I found the mistake is the file name:
for CSV file
A_B_C.csv --> ABC.csv
for .dat file:
A_B_C.dat -> A_B_C.dat
I written ABC.dat that is why did not work.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by