How can I use matlab's command window from inside emacs?

2

I am trying to use matlab's command window from inside Emacs.

I typed M-! to get the prompt for the shell command, then I typed matlab, and as expected Matlab's command window opened inside emacs, as shown in this figure:

alt text

The problem is that when I try typing commands nothing happens. More specifically, what I type appears there (in the figure you can see that I typed "demo"), but pressing return doesn't behave as expected. Instead of running the command, the prompt simply goes to the next line.

I told my friend about this command (M-! matlab), he tried and it worked on his computer (a Mac and Aquamacs, just like me), that is, he can now use Matlab from inside Emacs.

Why doesn't it work on my computer? Do I have some option turned off or something?

Vivi

Posted 2010-08-14T04:31:35.203

Reputation: 258

Answers

3

I guess you are using DOS-style line ends but you need Mac style ones. Try to change it using M-x RET p

The MATLAB / Emacs integration project may be a better way to run MATLAB inside Emacs.

Florian Diesch

Posted 2010-08-14T04:31:35.203

Reputation: 3 380

Florian, M-x is usually followed by the name of the command, not by RET. When I type M-x RET it says "no command name given". Also, Aquamacs is exclusively built for Mac, so I really don't see why it would call anything from Windows (I see that it is written DOS, but this is there even when the matlab command window is not open - maybe it means something else, but I might be wrong). I am using a matlab mode already, which comes with Aquamacs. It might be the same one as the one you mentioned, but I couldn't even download the one above because it requires CVN or something else I dont have... – Vivi – 2010-08-15T10:53:38.737

Sorry, it should be C-x, not M-x. As I don't have neither a Mac nor Matlab I can't check if using DOS line ends really causes this problems but it's something to try. On http://matlab-emacs.sourceforge.net/faq.shtml there's a Matlab script to download the Matlab mode without using CVS if you want to try it.

– Florian Diesch – 2010-08-15T11:48:01.880

When I type "C-x RET p" it asks me for the "coding-system for output from the process". What should I put there? – Vivi – 2010-08-15T22:40:55.513

The friend I mentioned above gave me his matlab.el file and the commands to put on my .emacs file, and now it all works. I am not sure, but I think what he gave me is what you also mentioned in your answer. Thanks for your help. – Vivi – 2010-08-16T08:49:46.727