Is it possible to execute scripts, that don't end in .m ?

I would like to be able to execute one script with latex and Matlab. It works if I rename the script from myscript.tex to myscript.m to run it in matlab and the change the name back to run it with latex. It would be nicer if it could just leave it called myscript.tex.
Is this possible?

 Respuesta aceptada

Daniel Shub
Daniel Shub el 25 de Mzo. de 2012
No, you cannot do this. You could create a link (I am not sure if symbolic or hard would be the way to go here). If it runs in MATLAB, it seems like it must be MATLAB code. Are you just importing/inputting it with LaTeX? You can do \input(foo.m) in LaTeX.

Más respuestas (1)

Georg Ramer
Georg Ramer el 25 de Mzo. de 2012
creating a link seems to do the trick, in windows cmd line:
link myscript.tex myscript.m
And without linking \input{myscript.m} in an otherwise empty .tex file also works.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by