How to run two parallel processes independently but with linked variables?
Show older comments
while i<100000,
A (i) = sin(2*i);
if (i< 100000),
disp(A(i));
pause(0.01);
end
i = i+1;
end
Here, the computation of A(i) has to be stopped for a period of 0.01 sec due to if loop. I want to keep computing the A(i) irrespective of the pause(0.01), but still display current A(i) value at a fixed interval of 0.01sec. Its like two parallel process, but one process need to access the variable of other process. How to achieve this?
Answers (1)
Walter Roberson
on 3 Oct 2015
0 votes
You can use spmd. In one lab compute the values, and use labsend() to send them to another process, which displays them at the desired rate.
1 Comment
Sai Kalyan
on 15 Oct 2015
Categories
Find more on Variables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!