# Link to local Matlab file

I'm working on a document with hundreds of figures, that are generated from matlab. From time to time, I have to change among the hundreds of .m files to generate the corresponding matlab figure and therefore makes quite cumbersome the whole work.

I'm interested in a solution something like below, so that when I click any figure (or link) in generated .pdf (or in .tex) file the corresponding matlab .m file will open in Matlab.

Thanks

\documentclass{article}
\usepackage{hyperref}
\begin{document}

• This would require a connection between the figure and the relevant matlab file, i.e. Figure A must 'know' that it has been generated with matlabA.m and Figure B is from matlabB.m – user31729 Feb 27 '17 at 8:14
• Perhaps something like attachfile2 package provides is an alternative? – user31729 Feb 27 '17 at 8:58