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
Angelo Yeo 2024 年 9 月 12 日
Can you tell us how to reproduce this issue?
Matt J
Matt J 2024 年 9 月 12 日
編集済み: Matt J 2024 年 9 月 12 日
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
Matt J 2024 年 9 月 12 日
It also happens with spmd blocks
Epsilon
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 日
Yep. I can create a new function manually but there's a button to create new function.
Epsilon
Epsilon 2024 年 9 月 12 日
編集済み: Epsilon 2024 年 9 月 12 日
Yes I meant after you press that button, it also has a dropdown to add private function and public function. And didn't realize Matt had already replicated it and replied above. So yes it is a bug!

サインインしてコメントする。

 採用された回答

Angelo Yeo
Angelo Yeo 2024 年 9 月 12 日

0 投票

@구구, thank you for reporting this.
@Matt J, thank you for the reproduction steps. I was able to reproduce the issue in R2024b.
I have internally reported the issue. However, please note that the official route to report a bug is to reach out to MW Technical Support.
Thanks!

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

リリース

R2024a

質問済み:

2024 年 9 月 12 日

回答済み:

2024 年 9 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by