Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buffSize = 10;
- circBuff = nan(1,buffSize);
- for newest = 1:1000;
- circBuff = [newest circBuff(1:end-1)]
- end
- nBuffer = 10; % You can set this to whatever number of time points
- % you want to store data for
- nSamples = 2; % You can set this to the number of data values you
- % need for each point in time
- centroidBuffer = zeros(nSamples,nBuffer); % Initialize the buffer to zeroes
- keepLooping = true;
- while keepLooping,
- % Capture your image
- % Compute the centroid data and place it in the vector "centroidData"
- centroidBuffer = [centroidBuffer(:,2:end) centroidData(:)];
- % Do whatever processing you want to do on centroidBuffer
- % Choose to set keepLooping to false, if you want
- end
- keepLooping = true;
- processTime = 0;
- while keepLooping,
- % Capture your image
- % Compute the centroid data and place it in the vector "centroidData"
- centroidBuffer = [centroidBuffer(:,2:end) centroidData(:)];
- processTime = processTime+1;
- if (processTime == nBuffer),
- % Do whatever processing you want to do on centroidBuffer
- processTime = 0;
- end
- % Choose to set keepLooping to false, if you want
- end
- ...
- if (processTime == nBuffer/2),
- ...
Add Comment
Please, Sign In to add comment