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

1 vue (au cours des 30 derniers jours)
Ali Abdallah
Ali Abdallah le 1 Déc 2015
Commenté : Ali Abdallah le 1 Déc 2015
I want to run to execute 2 matlab script multiObject1.m and multiObject.m at the same time

Réponse acceptée

Walter Roberson
Walter Roberson le 1 Déc 2015
Modifié(e) : Walter Roberson le 1 Déc 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 commentaires
Guillaume
Guillaume le 1 Déc 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 le 1 Déc 2015
Ok i will try thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by