Unable to read an imported CSV

조회 수: 92 (최근 30일)
Camille Woicekowski
Camille Woicekowski 2020년 6월 1일
댓글: Camille Woicekowski 2020년 6월 1일
Hi,
I'm trying to upload and open/read a CSV file. I used the "import data" tab on the Home bar to upload the file, then I tried to use the data using various commands (ie. m = readtable('filename.csv') and m = csvread('filename.csv')) but I get the error message
"Unable to find or open the file. Check the path or filename or file permission" or "file not found"
The name is definitely correct. I'm not sure how to check the path or permission.
I've tried this in both a livescript and the command window and I get the same message, even though the file is listed in my workspace.
  댓글 수: 2
madhan ravi
madhan ravi 2020년 6월 1일
Mind uploading the file?
madhan ravi
madhan ravi 2020년 6월 1일
Well how do you expect others to help if you don't provide the experimental file?

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 6월 1일
편집: Cris LaPierre 2020년 6월 1일
This error message suggest the file is not in your current folder. You likely had to browse to it when you used the import tool.
Fun fact - since you have imported the data already using the Import Tool, and can see the variable in your Workspace, there is no need to now use readtable or csvread. It's already been loaded.
If you instead want to use readtable or csvread, you need to either
  1. Change your current folder to be the folder containing your data file or
  2. Add the folder containing the file to your MATLAB path (see here)
  댓글 수: 1
Camille Woicekowski
Camille Woicekowski 2020년 6월 1일
Great, I figured it was something having to with the file location. I was able to access the data, thanks so much!

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

카테고리

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