How do I run parallel dependent loops?
이전 댓글 표시
I have a simulation that has two parts. A control loop and an identification loop. The control loop runs at a high sampling rate. The identification loop is computationally intensive. The information generated by the identification loop is helpful but not necessary for the control loop to run.
Ideally, I would like to have a simulation where the identification loop sends information to the control loop whenever its done computing. The control loop uses whichever latest identification information it has.
Is there a way I can do this?
댓글 수: 2
José-Luis
2013년 5월 20일
What does your code look like? Could you give an example? How do you intend to perform parallelization of the tasks?
Rushikesh Kamalapurkar
2013년 5월 23일
답변 (1개)
Walter Roberson
2013년 5월 20일
1 개 추천
If you were to use smpd then you could use labsend() to send values from the identification worker to the control worker.
The traditional structure would be to construct the control loop as a BytesAvailableFcn callback or timer callback (as appropriate) that would interrupt the main computation as necessary, and would draw upon the current values of variables stored by the identification loop. You would, I figure, need at least two buffers of the variables, one being read from and one being written to.
카테고리
도움말 센터 및 File Exchange에서 Linear Model Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!