Integrating a function that has a codistributed array as a parameter

1 view (last 30 days)
I am receiving the following error message:
Error using integralCalc/iterateArrayValued (line 159)
Inputs must be floats, namely single or double.
My code calls
numf=integral(@fitest,-1,1,'ArrayValued',true,...
'RelTol',1e-4,'AbsTol',1e-4);
where fitest is defined as follows
function y=fitest(t)
ft1=exp(-1i*t.*x);
ftk = (0.6667)*( (1-t.^2).^3 + (1-t.^2).^3 )...
-0.1667*( (1-(2*t).^2).^3 + (1-(2*t).^2).^3 );
sigUF2 = sigmaUF2*ones(1,n);
num = exp(-0.5*(1/h^2)*(t.^2)*(sigUF2+kron(ones(xlen,1),sigma2')));
den_k = exp(-0.5*(1/h^2)*(t.^2)*sigma2);
den = sum(den_k, 1);
y=real((1/(2*pi))*ft1.*ftk.*num./den);
end
The input t is a scalar, and the parameter x in the function is a matrix. The code works when run normally, but I am now trying to process larger datasets, and to do I am using the parallel processing command spmd and making x into a codistributed array. I now get the error message above. Can anyone confirm that this is due to the codistributed array parameter? Any suggestions on how to get around this?
  1 Comment
Matt J
Matt J on 13 Oct 2015
Edited: Matt J on 13 Oct 2015
Seems doubtful that codistribution would be the reason. Show us how x is created. Also show us how it finds its way into the workspace of fitest() seeing as fitest only takes t as an input argument.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!