Using parfor in app designer

3 ビュー (過去 30 日間)
S. Hannan
S. Hannan 2023 年 11 月 16 日
コメント済み: S. Hannan 2023 年 11 月 16 日
Hi,
I use the following code in matlab to implement parallel calculation:
Var1=linspace(-5,5,10);Var2=zeros(1,10);
parfor AA=1:10
Var2(AA) = Function(Var1(AA));
end
But, when I change it (as the code below) and want to use it in my app, I face an error.
app.Var1=linspace(-5,5,10);app.Var2=zeros(1,10);
parfor AA=1:10
app.Var2(AA) = Function(app,app.Var1(AA));
end
I appreciate any helps.

回答 (1 件)

Pratyush
Pratyush 2023 年 11 月 16 日
Hi Hannah,
I understand that you want to use parfor in app designer but you are getting an error.
Try changing your `Function` definition to `static`, and that should work. Refer to the following MATLAB answer that addresses a similar query: https://in.mathworks.com/matlabcentral/answers/1765490-is-it-possible-to-use-parallel-computation-in-app-designer
  1 件のコメント
S. Hannan
S. Hannan 2023 年 11 月 16 日
Thanks for your reply.
I have read the post, but it didn't help.

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

カテゴリ

Help Center および File ExchangeParallel Computing Toolbox についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by