title: How to create a multi-layer perceptron in Matlab for a multi-class dataset
body: <p>I want to create a double layered perceptron for an assignment.<br>
  It will act as a classifier for the Fisher iris data set.</p>
  
  <p>I've come across the following problems while creating the network:</p>
  
  <ul>
  <li>For a dataset like the above, can i setup the network with a single
  input and pass the whole training matrix of n rows and 4 features as
  an input value? Or, do i need to adjust the network to use 4 input
  node, 1 for each feature, and pass the training matrix as an input
  value?</li>
  <li>Furthermore, how do I properly connect the layers with each other?<br>
  For instance, when i create a perceptron with 4 inputs using the
  network command, I don't really understand what do the biasConnect, inputConnect and layerConnect actually do.</li>
  <li>Lastly, how many outputs do i need to correctly classify one element?
  Every example I've come across uses one output, but, will just one
  suffice? Or, do I need one for each class?</li>
  </ul>
  
  <p>Command used for creating the network mentioned at the second point:</p>
  
  <pre><code>net = network(4, 2, [1; 0], [1 1 1 1;0 0 0 0], [0 0; 1 0], [0 1]);
  </code></pre>