title: My for loop for a matrix is not working
body: <p>Suppose I have a matrix <code>[1 2 3 5;1 3 4 5]</code>.<br>
  Each row represents a path and each column represents the nodes of that path.<br>
  For example: for row <code>1</code> : <code>1-2-3-5</code> is a path with nodes <code>1</code>, <code>2</code> ,<code>3</code>, <code>5</code> (where <code>1</code> is the start node and <code>5</code> is the end node).<br>
  I want to consider an arc and arcs following that arc.<br>
  For example: I want to consider <code>(1,2)</code> and <code>(2-3)</code> and assign a cost to it.  </p>
  
  <p>I wrote a code but its showing an error.</p>
  
  <pre><code>for kkp = 1:size(R{ip},1) % R{ip} is my path matrix
      for jjp = 1:size(R{ip},2)-1
          for iip = 1:size (R{ip,2} -2)
              up = R{ip}(kkp,jjp);
              vp = R{ip}(kkp,jjp+1);
              wp =  R{ip}(kkp,jjp+2);
              cost1 = wt(up,vp); %wt(i,j) is a cost matrix that i already inputed.
              cost 2 = wt(vp,wp);
          end
      end
  end
  </code></pre>