Getting callback from MatLab to the Command Line

5 vues (au cours des 30 derniers jours)
elBarto314
elBarto314 le 3 Mar 2019
Hello,
my current project uses some batch script which shall:
1. do some stuff
2. then call MatLab with a m-script which takes some time to execute (around an hour)
3. after finishing this m-script, MatLab shall stay open
4. then the batch script shall do some further stuff
So, now the question is if there are some callback options in MatLab which inform the caller (batch script) that some task just finished (the -wait flag is not an option, because MatLab must stay open).
Thanks!
  3 commentaires
elBarto314
elBarto314 le 3 Mar 2019
I meant a Windows .bat file (respectively a powershell script in the near future, but I think that should not make a huge difference).
This question is probably a bit weird, but what I want to know is (in principle), if a matlab instance can somehow communicate back to the script (.bat or .ps1) which opened this matlab instance (with "matlab -r some_m_script").
Probably by receiving the output of the matlab command line through stdout or something similar (or getting a callback through some communication channel).
(Some background information:
a second tool shall do some testing on Simulink models and has to connect to this matlab instance via a matlab access server once some preparation is done. But as mentioned before this preparation can last up to an hour. Therefore, I wanted to ask if MatLab can somehow interact with the .bat script, such that this script knows when to start the second tool)
Walter Roberson
Walter Roberson le 3 Mar 2019
I am not familiar with .bat and powershell.
On Unix type systems I would probably do something like create a co-process and monitor its stdout, watching for it to write some particular output such as "Ready Player One"
However, I am not sure what you mean by "connect to this matlab instance via a matlab access server" ? If you are referring to the COM Server API, then I am not certain that you can use an existing process that was not started by the COM Server API.
Does it really have to be the same MATLAB instance, or could you save() after the first and load() when you opened the COM Server ?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Write COM Applications to Work with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by