how to run 2 script .m at the same time in matlab?

2 visualizaciones (últimos 30 días)
Ali Abdallah
Ali Abdallah el 1 de Dic. de 2015
Comentada: Ali Abdallah el 1 de Dic. de 2015
I want to run to execute 2 matlab script multiObject1.m and multiObject.m at the same time

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Dic. de 2015
Editada: Walter Roberson el 1 de Dic. de 2015
Well, if you really need to do that (the cases are fewer than one might expect) then you will need to use the Parallel Processing Toolbox, and use either parfor or spmd. If the two will need to communicate with each other than spmd would be recommended.
However, when people say they need to run two scripts at the same time, they often mean that one script has to be able to gain control temporarily, do a bit of work, and then allow the other script to continue. It is not uncommon to be able to program that with callbacks of various kinds of events without needing the Parallel Processing Toolbox.
  7 comentarios
Guillaume
Guillaume el 1 de Dic. de 2015
No, it will not work. As Walter said, only one script at a time can update what is shown on screen.
To do what you want you'll need to have:
  • main code (script) in charge of displaying both processed video frames at the same time
  • 1st background script in charge of processing the video from one angle. Has to communicate with main code to give it the processed frame when done
  • 2nd background script in charge of processing the video from the 2nd angle. Also has to communicate with main code to give it the processed frame when done
If you don't have the parallel toolbox, then the background scripts would have to be called sequentially on each video frame and display may be far from real time.
Ali Abdallah
Ali Abdallah el 1 de Dic. de 2015
Ok i will try thanks

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by