App designer creates a new function inside another function where a parfor loop exists
이전 댓글 표시

As the title suggests, it is created in an existing function with a parfor loop when creating a new function in App Designer. Commenting out the parfor loop creates the new function as normal.
댓글 수: 6
Angelo Yeo
2024년 9월 12일
Can you tell us how to reproduce this issue?
I see it in R2023b as well.
@Angelo Yeo Just create a new app method called testFunction() in the code view and add a parfor loop to it, like that shown in the OP. Then create yet another method, using the code browser

called func17(). You will see that it is created as a nested function within testFunction().
Matt J
2024년 9월 12일
It also happens with spmd blocks

Epsilon
2024년 9월 12일
Hi, I tried the same and you are right it adds the new private function before the end of the function body when using ‘parfor’. Although adding a new public function, is placed correctly after the function body.
It seems manually editing after adding the function is the only workaround.
구구
2024년 9월 12일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!