Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
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 Aug 15 '10 at 10:53
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 there's a Matlab script to download the Matlab mode without using CVS if you want to try it. – Florian Diesch Aug 15 '10 at 11:48
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 Aug 15 '10 at 22:40
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 Aug 16 '10 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .