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 中查找有关 Desktop 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!