run two program(infinite loop) prallel in matlab

조회 수: 7 (최근 30일)
Lalji goti
Lalji goti 2014년 1월 16일
댓글: Walter Roberson 2015년 5월 31일
Hello,
how can i run two infinite loop parallel in matlab.
data listening infinite loop
while 1
while ~(iStream.available)
end
readS(iStream);
end
command sending infinite loop
while 1
userInput = input('Server: ', 's');
oStream.sendS(userInput);
end
how can i run this both infinite loop program parallel in matlab plz help me out

채택된 답변

Walter Roberson
Walter Roberson 2014년 1월 16일
You should probably use a single program, with the input from the robot handled by firing a timer() object, or by using a callback, such as a BytesAvailableFcn.
  댓글 수: 13
Walter Roberson
Walter Roberson 2014년 1월 17일
As I posted above:
and look down to "Defining an Asynchronous Read Callback"
Lalji goti
Lalji goti 2014년 1월 21일
finally i have achieved.. thanks for your kind help. my project is complete..
thank you very very much

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Haiko
Haiko 2014년 1월 16일
Using parfor might be a solution. Your code has to be rewriten a bit. See as well the help function on parfor.
  댓글 수: 3
bsissa soufien
bsissa soufien 2015년 5월 31일
hi I can modify a spin protocol source code in wireless sensor network domain to optimize energy and diminier connsommation and here is the source code of spin protocol:
Walter Roberson
Walter Roberson 2015년 5월 31일
The source did not end up attached. But this would not be the right Question to attach it to as the Question does not pertain to WSN.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Clocks and Timers에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by