Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.m files as MATLAB/Octave for Sublime Text

Sublime sees .m files as Objective C files.

I've been given a bunch of MATLAB/Octave files to work with using Octave, all with .m extensions.

If I change the extensions to .matlab, then Sublime will recognize them and format them correctly, but then Octave doesn't see them.

I would like to either:

(1) alter Sublime so that it recognizes .m as MATLAB/Octave instead of Objective C, or

(2) tell Octave to recognize .matlab as something it can just run.

I've poked around on the Sublime and Octave sides of this, but to no avail (this is not the answer), and I'm an Octave noob. Thank you.

like image 504
scharfmn Avatar asked Aug 22 '12 20:08

scharfmn


People also ask

Can octave run .m files?

Simply type the filename without extension . Type run("filename. m") in the command line of Octave . Then press ctrl + c to exit the file in middle of the run .

Can I run Matlab files in octave?

Octave is mostly compatible with Matlab. Most matlab functions can be made to run with very little change. With careful coding, you can get your code to run without change in Matlab and Octave.

Does Sublime Text support Matlab?

So there is a package called SublimeREPL (https://github.com/wuub/SublimeREPL) that make use of this property and runs MATLAB directly from Sublime Text. You can also use that for this purpose.


1 Answers

Sublime 2 can be configured to associate certain file extensions to certain syntax highlighting schemes. See this answer for exactly how to do it https://stackoverflow.com/a/8014142/694184

like image 194
Eric Leschinski Avatar answered Nov 08 '22 06:11

Eric Leschinski