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:

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?