for loop

4 views (last 30 days)
Pan
Pan on 29 May 2012
this is my current code
mean(sum(abs(xw(:,:,3,10))-(xw(:,:,3,9))));
this can run and have value but this code could calculate tenth frame and ninth frame
but now, I must calculate the 100 frames that from fourth frame to 100th frames I know to use " for loop", but I can't write please tell me how to do

Accepted Answer

Image Analyst
Image Analyst on 29 May 2012
Let's say that "k" is your for loop index. Then just say:
mean(sum(double(xw(:,:,3, k)) - double(xw(:,:,3, k-1))));
to get the mean column-by-column difference in the blue channels of your video frames.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!