フィルターのクリア

parfor-value is not accessible

2 ビュー (過去 30 日間)
Amirah Algethami
Amirah Algethami 2023 年 3 月 15 日
編集済み: Amirah Algethami 2023 年 3 月 16 日
I have along costracted code;
%%%%%%%%%%%%%%%%%%%
Function handle
odefunction1 handle
odefunction2(useing variable lamda) handle
pool;
parfor i=1:n
forj=1:m
if (ode1,event not trigured )
continue
elseif (ode1, event trigured )
lamda=Constant+(values from odesolver);
use ode2
end
end
end
end
%%%%%%%%%%%%%%%%%%
when excute this code it give me:
An UndefinedFunction error was thrown on the workers for 'lamda'. This might be because the file containing 'lamda' is not accessible on the workers. Use addAttachedFiles(pool, files)
I checked How to attached file , but it is not working , I came across load function but I did not succeed.
My Q. How to solve this problem?
Thanks in advance.

回答 (1 件)

Raymond Norris
Raymond Norris 2023 年 3 月 15 日
Can you reformat you post by highlighting your code and putting it into a CODE block?
How are you running your parallel code, for instance
parpool(X)
your-code
Is the code running locally? On a cluster? How are you attaching files to your job?
  1 件のコメント
Amirah Algethami
Amirah Algethami 2023 年 3 月 16 日
編集済み: Amirah Algethami 2023 年 3 月 16 日
Hi ;yes I am runing it locally,I dont need attach file all helper functions nested in the main function.
But Howerver error message says; you have to attached file for lamda??

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

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by