Matlab: How to use a .dat file in Neural Network?
<p>I'm trying to use a .dat file's data to create an RBF neural network and train it. But I don't know how to use it's columns as <em>input</em> and <em>target</em> data in the network.</p>

<p>This is an image of the file in matlab:
<a href="http://i.stack.imgur.com/Fx3HO.png" rel="nofollow">train.dat</a></p>

<p>I tried this:</p>

<pre><code>fid = fopen('train.dat','r');
A = fscanf(fid, '%f');
C1 = textscan(fid,'%s%f%s%f');   %read the first line
nb_col = C1{4};                     %get the number of columns (could be set by user too) 

%read the remaining of the file
C2 = textscan(fid, repmat('%f',1,nb_col), 'CollectOutput',1);

fclose(fid);                     %close the connection
</code></pre>

<p>My question is what code should I write at the beginning to open the <strong><em>train.dat</em></strong> file and put it's first column into a vector (patterns) and it's third column in another vector (target)?</p>