|
I'm trying to read a file that includes strings and numerical data with textscan command. After importing this data, i'll use it for neural network training.
My dataset is kdd'99 dataset ( could be seen here: http://mlr.cs.umass.edu/ml/databases/kddcup99/kddcup99.html will use 10% ones) and looks like:
0,tcp,smtp,SF,829,327,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0.00,0.00,0.00,0.00,1.00,0.00,0.00,8,113,0.88,0.25,0.12,0.02,0.00,0.00,0.00,0.00
Data dimensions are very large, so want to make a trial with first 19 rows of the dataset and used this commands:
fid = fopen('ked.txt');
hadi=textscan(fid, '%u8, %s, %s, %s, %u16, %u16, %u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%u8,%f,%f,%f,%f,%f,%f,%f, %u16, %u16,%f,%f,%f,%f,%f,%f,%f,%f',19);
fclose(fid);
Then let's say i need to set the first 3 columns of first 15 lines as training data, so i use this command:
P= hadi(1:15, 1:3);
and i get this error:
??? Index exceeds matrix dimensions.
hadi is 1x42 matrix, and i cant fix it to be 19x42. My matlab version is R2006a.
PS: i've also tried textscantool but i've also faced with different errors, couldnt even make it work.
All the suggestions are welcome!
|