フィルターのクリア

Undefined function 'savetofile' for input arguments of type 'sym

1 回表示 (過去 30 日間)
Fede C 2018 London
Fede C 2018 London 2022 年 8 月 15 日
回答済み: Walter Roberson 2022 年 8 月 16 日
Hi all,
I'm using a co-author's program from a published paper and while running his code with different data, I ran into the following error message:
Error using runDLRsym (line 40)
The source code (C:\Users\nkhoz\Desktop\Wed10Aug\ReplicationFiles_Empirical\BenchmarkModel\PrepWald\runDLRsym.m) for the parfor-loop that is
trying to execute on the worker could not be found.
Error in RunPrep (line 6)
runDLRsym(nv, ng);
Caused by:
Undefined function 'savetofile' for input arguments of type 'sym'.
Error using remoteParallelFunction (line 84)
Worker unable to find file.
Undefined function 'savetofile' for input arguments of type 'sym'.
After I asked him about it, he ran the program and the he got the same error message back (this program used to work just fine). Neither of us has any idea. I was hoping someone would be kind enough to help me work this out? Apparently SaveToFIle was introduced in 2015, but I'm not aware/cannot find any info of it being replaced by something else. I do have the symbolic toolkit add on, so that's not the issue.
For the sake of clarity, here are the lines that Matlab isn't happy with. Line 40 is from this:
function runDLRsym(nv, ng)
...
...
...
...
for row = 1:nv
parfor col = 1:ng-1
name = sprintf('DLRsym%d%d',row,col);
varr = DLRsym(row,col);
savetofile(varr,name);
end
end
toc
Line 6 from the program that calls DLRsym is here:
tic
%parpool(4)
nv= 6;
ng = 3;
runDLRsym(nv, ng);
toc
getjacobDLR(nv, ng);
toc
%4000 seconds to run
  2 件のコメント
Benjamin Thompson
Benjamin Thompson 2022 年 8 月 15 日
Maybe savetofile is a local function on your system and you are not pushing it to the parallel workers or your MATLAB path is not pushing to the parallel workers? You use parforOptions to add additional files to send to workers, and maybe the automatic dependency analyzer is missing that one.
Fede C 2018 London
Fede C 2018 London 2022 年 8 月 15 日
Hi Benjamin, thanks for your message. I haven't written any parts of this program myself, so I'm a bit in the dark-do you mean that the author(s) had programmed their own function called savetofile and that is the bit that might be missing?

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

採用された回答

Walter Roberson
Walter Roberson 2022 年 8 月 16 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by