Hello all,
I am trying to run this following code in parallel but got this error:
Error using realTime_pointGrey>(parfor body) (line 52)An UndefinedFunction error was thrown on the workers for 'getsnapshot'. This might be because the file containing 'getsnapshot' is not accessible on the workers. UseaddAttachedFiles(pool, files) to specify the required files to be attached. See the documentation for 'parallel.Pool/addAttachedFiles' for more details.Error in realTime_pointGrey (line 50) parfor id = 1:4Caused by: Undefined function 'getsnapshot' for input arguments of type 'struct'.
I am not very familiar with using addAttachedFiles, could you please help me?
The code I am working on:
parfor id = 1:4 % Get the snapshot of the current frame
data(:,id) = reshape(double(rgb2gray(getsnapshot(vid))),size(data0,1)*size(data0,2),1); end data_mean = mean(data,2);
Best Answer