run two program(infinite loop) prallel in matlab
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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
2014-1-17
As I posted above:
and look down to "Defining an Asynchronous Read Callback"
更多回答(1 个)
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
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
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 Center 和 File Exchange 中查找有关 Clocks and Timers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!