Running a UI based function on a separate worker.
古いコメントを表示
Hey all, I have a matlab function that opens a user interactive window and takes some inputs from the user and does some calculation which are displayed only on interactive window itself(no outputs). The calculations take a lot of time so I tried running it as a batch but ended up with the following error,
The script or function that will be called on the worker must be a single string or function handle.
Any ideas as to what the problem might be? Just to be clear, I am calling a single function in the batch but that function in itself calls other functions.
回答 (1 件)
Walter Roberson
2016 年 12 月 19 日
0 投票
Your slightly later Question http://www.mathworks.com/matlabcentral/answers/317430-input-argument-error-while-running-a-batch-function suggests that you were calling batch() incorrectly, but it is difficult for us to be sure as you did not post your code.
7 件のコメント
hemant
2016 年 12 月 19 日
Walter Roberson
2016 年 12 月 19 日
The syntax
@ folder1.folder2.func1
is not valid, not unless folder1 is created as a "package" and folder2 is created as a package within the first package. That would require that the directory structure be
+folder1/+folder2/func1.m
where the '+' are literal parts of the directory name.
You cannot use @ to create a function handle to an arbitrary location: other than with packages, you can only create handles to functions that are on your path.
hemant
2016 年 12 月 19 日
José-Luis
2016 年 12 月 19 日
Famous last words...
Walter Roberson
2016 年 12 月 19 日
I suggest experimenting with
funcHandle = @(x) folder1.folder2.func1(x)
hemant
2016 年 12 月 19 日
Walter Roberson
2016 年 12 月 19 日
Can you zip up your code and attach it?
カテゴリ
ヘルプ センター および File Exchange で Share and Distribute Software についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!