I have a long script calling many other scripts that spit out a lot of figures.

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?

I thought I could implement something like

```
A=[];
figure
plot(x)

A=ginput(1)

if A~=[]
  goto(pointer,line)
end

```

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.

In other words: is there a way to go to a specific line of the code by clicking on a figure?

N.B. For an implementation of GOTO see ([GOTO FileExchange](http://www.mathworks.com/matlabcentral/fileexchange/26949-matlab-goto-statement))