I'm new to matlab. I have the a file named iris.data and I'm trying to load it's contents into variables. The file have the folowing contents:
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
4.6,3.1,1.5,0.2,Iris-setosa
5.0,3.6,1.4,0.2,Iris-setosa
5.4,3.9,1.7,0.4,Iris-setosa
4.6,3.4,1.4,0.3,Iris-setosa
5.0,3.4,1.5,0.2,Iris-setosa
4.4,2.9,1.4,0.2,Iris-setosa
4.9,3.1,1.5,0.1,Iris-setosa
5.4,3.7,1.5,0.2,Iris-setosa
4.8,3.4,1.6,0.2,Iris-setosa
4.8,3.0,1.4,0.1,Iris-setosa
I tried:
load iris.data
But I got:
Error using load
Unknown text on line number 1 of ASCII file iris.data
"Iris-setosa".
why it's giving me this error, or I'm totally went on the wrong direction, and there is a better way to do it.
Thanks!!
In cases where you absolutely don't know how to import your data, just use the Import Data GUI and generate a script.
This is what you get for your case:
and you get:
The scripts you get are really well commented and you can apply it on almost any case and learn ;)