for f = startingFrame+1 : finalFrame
frame = aviread(inFile, f);
i2 = frame.cdata;
ig2 = rgb2gray(i2);
[c2,n2] = imhist(ig2);
c2=c2/size(ig2,1)/size(ig2,2);
d = pdist2(c1',c2','cityblock');
if (d > 0.2150)
c1 = c2;
m = im2frame(i2);
mov = addframe(mov,m);
pause(1/FPS);
end
disp(d);
hold on;
axis([1 95 0.16 0.26]);
plot(f,d,'--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10);
end
1 Comment
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/90680-how-do-i-combine-multiple-plots-in-a-for-loop#comment_175077
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/90680-how-do-i-combine-multiple-plots-in-a-for-loop#comment_175077
Sign in to comment.