Question

Is there an Emacs major mode for MATLAB and / or Octave files? For those who don't know, MATLAB files generally have a ".m" file extension.

My primary interest is GNU Emacs but XEmacs tips would also be appreciated.

Was it helpful?

Solution

Have you tried the octave-mode that is part of the standard emacs distribution? I have found that this works well.

If you're finding it doesn't associate the .m extension, add this to your .emacs:

(setq auto-mode-alist
      (cons
       '("\\.m$" . octave-mode)
       auto-mode-alist))

OTHER TIPS

You'll be wanting http://matlab-emacs.sourceforge.net/ , I would imagine? Read the instructions there.

I used an ancestor of this years ago in XEmacs, so it certainly used to have support for it, but I believe the author is an GNUEmacs user. The guy who wrote it (Eric Ludlam) is a Mathworks employee, so it has vague official credentials.

Not built in in GNU Emacs 22. I found a matlab mode on the web (elisp), but it dates from circa 2000, so I don't know what kind of support you have.

To install you must get emacs to load it, then invoke the mode. You can interactively issue a load-file (With M-x load-file) to test it.

There's a matlab.el file from Matthew Wette on The MathWorks File Exchange. The file doesn't appear to have been updated since 1997 (!), and simply says it is "for early versions of Emacs", but hopefully it will still be of use to you.

I recently downloaded a Matlab mode for Emacs from the Matlab Central file exchange. Works just fine. Don't recall exactly where I found it, if you have trouble let me know and I will look harder.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top