Error using load Unable to read file 'iris'. No such file or directory.

조회 수: 26 (최근 30일)
Edgar Torres
Edgar Torres 2021년 4월 14일
답변: Walter Roberson 2021년 4월 14일
I am starting to learn machine learning and starting with the basic iris knn classification. prior to anything though, I am noticing that I can't load the iris.data file that I downloaded from https://archive.ics.uci.edu/ml/datasets/Iris . My project is going to be located in the folder "ML Project", but to be sure, I have placed a copy of iris.data into all three top paths and I still get the error. Any idea what may be going wrong? I have added Fuzzy Logic and Machine Learning toolboxes.

답변 (1개)

Walter Roberson
Walter Roberson 2021년 4월 14일
When you do not give a file extension when you load(), then the only one MATLAB will search for is .mat . Your file is a .data file extension, so you would need to specify that.
However, the file is a text file that includes names, so you cannot load() it .
t = readtable('iris.data');
labels = t{:,end};
iris = t{:,1:end-1};

카테고리

Help CenterFile Exchange에서 Large-Scale Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by