How do I run parallel programs in Matlab?

2 visualizaciones (últimos 30 días)
Katherine
Katherine el 31 de Jul. de 2012
Hi I wish to run two loops independently. Specifically, one loop will be playing a sound at random intervals while another loop will be constantly looking for a voltage source from a button click. Is it possible to run two programs simultaneously?
Thanks.

Respuestas (2)

E K
E K el 31 de Jul. de 2012
i can not understand why you saw them as two different programs from your explanation it looks like you can run it as one but;
might help.
  1 comentario
Katherine
Katherine el 1 de Ag. de 2012
how would you suggest running this as one program? from what i know about matlab, it can't do two things simultaneously.

Iniciar sesión para comentar.


Jan
Jan el 31 de Jul. de 2012
You can start the sound from a TIMER, which modifies its interval in the callback. But looking for a button click is usually not done in a loop, but by the callback mechanism of the button. Clicking on the button triggers the event, not looking for the status of the button in an endless loop.
  1 comentario
Katherine
Katherine el 1 de Ag. de 2012
The number of times and the time at which the button is pressed need to be recorded, and the only way I can think of to do that is to track voltage output of the button which indicates if the button has been pressed or not. Will I need a timer for each loop?

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by