i cant load 'factoryReports.csv' dataset

댓글 수: 4

KSSV
KSSV 2023년 6월 6일
Why you can't? What did you try? What error you are getting?
Hello Amir,
You can use the readmatrix() function to import a .csv file into MATLAB. Keep the .m file and .csv file in same directory.
M = readmatrix('factoryReports.csv')
For More info you can refer to this following documentation Read matrix from file - MATLAB readmatrix (mathworks.com).
Thankful
But I meant to download this file
data = readtable('factoryReports.csv','TextType','String'); % Read data
labels = categorical(data.Category); % Read labels
Error using readtable
Unable to find or open 'factoryReports.csv'. Check the path and filename or file permissions.
Ive J
Ive J 2023년 6월 6일
편집: Ive J 2023년 6월 6일
The error is self-explanatory, isn't it? readtable cannot find your file. Use full path to the file (E:\MyFiles\....\factoryReports.csv). Also make sure you have all the required permissions (e.g. admin).

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

답변 (1개)

Nikhil
Nikhil 2023년 6월 6일
편집: Nikhil 2023년 6월 6일

0 개 추천

Hi Amir,
There are a few potential reasons and troubleshooting steps you can try:
  1. Verify the file path: Double-check that you have provided the correct file path to the 'factoryReports.csv' dataset. Ensure that the file is located in the specified location and that the file name and extension are accurate.
  2. Check the current working directory: MATLAB looks for files in the current working directory by default. Make sure that the 'factoryReports.csv' file is either located in the current working directory or provide the full file path when loading the dataset.
  3. Check file permissions: Ensure that you have the necessary permissions to access and read the 'factoryReports.csv' file. If the file is read-only or restricted, you may encounter errors when attempting to load it.
  4. Check file name: Ensure that file name is correct and if still error persists then write whole address of the dataset.
I hope these steps will help you with your problem.
Thank you.

댓글 수: 2

Lisjak
Lisjak 2023년 12월 29일
There is no file on the computer?
Walter Roberson
Walter Roberson 2023년 12월 30일
readtable() can read from URLs if you have a URL for the file.

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

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

질문:

2023년 6월 6일

댓글:

2023년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by