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?

 Accepted Answer

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.

More Answers (1)

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!