title: matlab GOTO (sort of)
body: <p>I have a long script calling many other scripts that spit out a lot of figures.</p>
  
  <p>For debugging purposes I think it would be useful if -when clicking on a picture- the editor goes to a specific line. Does anyone know if this is possible?</p>
  
  <p>I thought I could implement something like</p>
  
  <pre><code>A=[];
  figure
  plot(x)
  
  A=ginput(1)
  
  if A~=[]
    goto(pointer,line)
  end
  </code></pre>
  
  <p>The problem is that it only would work only right after that the figure is made. Not at the end of the analysis when I take a look to the figures for eventual errors.</p>
  
  <p>In other words: is there a way to go to a specific line of the code by clicking on a figure?</p>
  
  <p>N.B. For an implementation of GOTO see (<a href="http://www.mathworks.com/matlabcentral/fileexchange/26949-matlab-goto-statement" rel="nofollow">GOTO FileExchange</a>)</p>