Hi all,
I'm just not quite clear why this won't work, or what I can do to fix it.
I get the error
Error: File: LabTracker_Serial_Parralel.m Line: 105 Column: 5The variable microMovie in a parfor cannot be classified.See Parallel for Loops in MATLAB, "Overview".
But it would seem to me like each loop is independent of the others. So shouldn't parfor be suitable here?
Any thoughts? Thank you
Here is the code,
microMovie = zeros(NumberOfTargets * pointsToSave, 3, numFrames);parfor i = 1: numFrames [sortedValues,sortIndex] = sort(ghostFrame(:),'descend'); maxIndex = sortIndex(1:NumberOfFlies * pointsToSave); [rowsub, colsub] = ind2sub([size(ghostFrame,1) size(ghostFrame,2)], maxIndex); microMovie(:,1,i) = rowsub; microMovie(:,2,i) = colsub; microMovie(:,3,i) = movieFrame(maxIndex);endsave('microMovie');
Best Answer