Reputation: 85
Im working on a program which shall manipulate .csv files from an Experiment. Therefore i want to use the command textscan
, which sounds really suitable for my Problem. But I got problems with the implementation of the code. My code Looks like this:
fid = fopen('filename.csv');
data = textscan(fid, '%*s %f %f %f %f %f', 'delimiter', ';', 'headerlines', 3);
fclose(fid);
For fid
I get the value "4". I dont understand why i get a number. Shouldnt I get an cell Array of my file?
My file consists of 3 Header, 1 column with text and the rest are numbers.
Thank you very much in anticipation! Best Regards!
Upvotes: 0
Views: 1233
Reputation: 112659
The fid
is a file identifier, that is, a number that is used to refer to that file. That's the number you pass to textscan
to read the file's contents. Those contents will be stored in data
.
Upvotes: 1