Using parallel computing WITHIN a Simulink simulation
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a for loop within a my simulink model (using the For Iterator block). In my case, I have around 2000-3000 iterations each time step. From my searching, I have only found that parallel computing can only be used to run simulations in parallel, rather than within a single simulation. Is it possible to use parallel computing for the for loop within a single simulink simulation?
댓글 수: 0
답변 (1개)
Ryan G
2012년 10월 23일
You cannot use parallel computing for this operation. Can I ask why you are doing this? Although there may be a perfectly valid reason, perhaps reconsidering your approach may help speed things up.
댓글 수: 2
Ryan G
2012년 10월 23일
편집: Ryan G
2012년 10월 23일
I don't believe you can do it in a MATLAB function either. Maybe, but I wouldn't try it.
Have you looked into turning the subsystem into a model reference and running in accelerator mode? That would definitely speed things up and is supported.
Lookup tables can also be kind of slow, have you considered alternatives to the lookup? If they are simple (2-d, maybe 3-d) you may be able to fit an equation to the data and use that instead. Might be faster.
I do want to reiterate what I mentioned earlier as this 1000 input line throws a red flag in my mind. Although it is fully possible this is the best/fastest way to do the operation you desire, whenever I see the same thing being repeated, I have to step back and look at the problem to make sure it's the best way to do it.
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!