Thank you in advance for any help you can give. I am relatively new to Matlab and am stuck with the use of the batch command for passing arguments to the function. I have tried to simplify the example as much as possible.
Following the documentation, I can get it to work with a built-in function:
>>
>> j = batch(@zeros,1,{10,1});
>> a=fetchOutputs(j)
a =
1×1 cell array
{10×1 double}
>> a{1}
ans =
0
0
0
0
0
0
0
0
0
0
I then created a simple stand-along function runTest.m:
function result = runTest(n1,n2)
result = zeros(n1,n2);
end
It works with a direct call:
>> a=runTest(5,1)
a =
0
0
0
0
0
But, it doesn't work using batch:
>> j = batch(runTest,1,{5,1});
Not enough input arguments.
Error in runTest (line 2)
result = zeros(n1,n2);
Any suggestions? Thank you.