Hi all,
I was wondering if anyone has any suggestions as to how one might use Textmate to interface with Matlab? I can have a command execute a given .m file, but Matlab is a much heavier process to load than perl is from the command line, so that becomes a very unattractive option.
Ideally I'd like to have Matlab running in a terminal (the java interface is just too slow for me), and edit with Textmate in such a way that commands could reach the already loaded session.
cheers,
-don
========================== Don Kalar Graduate Student, Cognitive Neuroscience UCLA Department of Psychology 1285 Franz Hall, Box 951563 Los Angeles, CA 90095-1563 ==========================
On 17. jan 2005, at 9:42, Don Kalar wrote:
Hi all,
I was wondering if anyone has any suggestions as to how one might use Textmate to interface with Matlab? I can have a command execute a given .m file, but Matlab is a much heavier process to load than perl is from the command line, so that becomes a very unattractive option.
Ideally I'd like to have Matlab running in a terminal (the java interface is just too slow for me), and edit with Textmate in such a way that commands could reach the already loaded session.
This would be similar to what emacs can do with a number of systems that are highly interactive in nature. It would probably require some things not currently in TextMate to be able to work in general, although one might be able to hack something together for a specific situation. I think I briefly discussed something like this with Allan a while back, and I think it was postponed a bit. But let's see what he says :-).
The way it is pulled off in emacs is due to its built-in language; I am not saying you must have a built in language to make it work, but it would probably be an advantage. Too bad AppleScript is kinda crappy ;-). Would be nice with a more powerful "scripting" language.
On Jan 17, 2005, at 9:46, Sune Foldager wrote:
[...] I think I briefly discussed something like this with Allan a while back, and I think it was postponed a bit. But let's see what he says :-).
Weren't the outcome of that discussion that you'd do tty emulation for TextMate? ;)
On Mon, 17 Jan 2005 09:46:01 +0100, Sune Foldager cryo@cyanite.org wrote:
The way it is pulled off in emacs is due to its built-in language; I am not saying you must have a built in language to make it work, but it would probably be an advantage. Too bad AppleScript is kinda crappy ;-). Would be nice with a more powerful "scripting" language.
Happy to read this! IMHO writing applescript is too tedious and slow to get anything useful done, especially for text processing. Bindings to a real unixish scripting language would be way nicer... my preference goes to Ruby, but an ObjC API would enable more language-agnostic access (Python has Apple-provided ObjC support, don't know for Perl)
Also that API doesn't have to be so low-level as in Emacs to be useful... I don't need mail clients or games in TextMate ;-)
-- D
On Jan 17, 2005, at 9:42, Don Kalar wrote:
Ideally I'd like to have Matlab running in a terminal (the java interface is just too slow for me), and edit with Textmate in such a way that commands could reach the already loaded session.
I don't know if this is possible with matlab, but you might be able to do something like:
% mkfifo /tmp/matlab_in % matlab < /tmp/matlab_in
Then you can write to '/tmp/matlab_in' from TextMate and have matlab read it. I tried it with cat, but cat quits each time TextMate has written to the file. Probably because it sends an EOF, not sure how to avoid that, anyone?
I don't know if this is possible with matlab, but you might be able to do something like:
% mkfifo /tmp/matlab_in % matlab < /tmp/matlab_in
Excellent suggestion - writing to the pipe via echo with the `-n' flag keeps matlab from exiting after each command.
Thanks Allan!
-don
On 18.01.2005, at 03:55, Don Kalar wrote:
I don't know if this is possible with matlab, but you might be able to do something like:
% mkfifo /tmp/matlab_in % matlab < /tmp/matlab_in
Excellent suggestion - writing to the pipe via echo with the `-n' flag keeps matlab from exiting after each command.
This should definitely be mentioned in wiki. Anyone?
Cheers, -Ralph.
Don Kalar <donkalar@...> writes:
I don't know if this is possible with matlab, but you might be able to do something like:
% mkfifo /tmp/matlab_in % matlab < /tmp/matlab_in
Excellent suggestion - writing to the pipe via echo with the `-n' flag keeps matlab from exiting after each command.
Anyone willing to walk me through this? Do I need to add a command to the Matlab bundle?
I'm looking to keep a Matlab session running in a terminal, and be able to send snippets of code to this session via TextMate.
Thanks, -brian
On 4. Nov 2006, at 17:36, Brian wrote:
I don't know if this is possible with matlab, but you might be able to do something like:
% mkfifo /tmp/matlab_in % matlab < /tmp/matlab_in
Excellent suggestion - writing to the pipe via echo with the `-n' flag keeps matlab from exiting after each command.
Anyone willing to walk me through this? Do I need to add a command to the Matlab bundle?
It’s not exactly simple -- I attached a ruby script I had lying around which starts ‘sh’ and accepts commands written to /tmp/ testpipe -- but it is a single direction connection, so the result stays with the master process.
I'm looking to keep a Matlab session running in a terminal, and be able to send snippets of code to this session via TextMate.
It sounds like this is a job for TerminalMate.
On 11/5/06, Allan Odgaard throw-away-1@macromates.com wrote:
It's not exactly simple -- I attached a ruby script I had lying around which starts 'sh' and accepts commands written to /tmp/ testpipe -- but it is a single direction connection, so the result stays with the master process.
I was never really pleased with anything I cobbled together - ideally what I wanted was to replace the java Matlab editor/command window front end with a Textmate/Terminal combination. I'm guessing you're looking for something similar, Brian.
It sounds like this is a job for TerminalMate.
Agreed, though I personally won't have time to mess with this for a few weeks. TerminalMate does look extremely promising...
cheers, -d