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

2 Ansichten (letzte 30 Tage)
Ali Abdallah
Ali Abdallah am 1 Dez. 2015
Kommentiert: Ali Abdallah am 1 Dez. 2015
I want to run to execute 2 matlab script multiObject1.m and multiObject.m at the same time

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 1 Dez. 2015
Bearbeitet: Walter Roberson am 1 Dez. 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 Kommentare
Guillaume
Guillaume am 1 Dez. 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 am 1 Dez. 2015
Ok i will try thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by