Can I give MATLAB commands in series from the OS command prompt?
Afficher commentaires plus anciens
My question seems like this:
I want to keep only one MATLAB instance open, and then feed the m-file or "Matlab command" to Matlab from system command line or bat/bash file.
(I do NOT want to call m-file or "Matlab command" from Matlab command window for some reason)
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 2 Août 2011
1 vote
If this is not MS Windows, you can create a pipe to a MATLAB session and send information back and forth. A difficulty with that is that MATLAB was not written with pipes in mind, and has no settings to adjust its buffering strategy or to force the output to be flushed (though you might be able to do explicit flushing with fflush()). Also, this would be effectively -nodisplay
If you are using MS Windows, then it has its own _pipe() call with slightly different semantics than the POSIX standard pipe() call. In theory, from XP SP2 and later, POSIX pipe() should work, but I have seen enough hints that you do not get "real" POSIX.1 that I would not trust that without hard testing.
To be clear, pipe() and _pipe() are at the OS level, not part of MATLAB.
3 commentaires
HaveF
le 3 Août 2011
Kaustubha Govind
le 3 Août 2011
The MATLAB Engine interface does use pipes on *nix Systems (COM on Windows). I think setting the visibility of the engine to true should also let you display results in the MATLAB window like you need.
HaveF
le 8 Août 2011
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!