for loop

2 次查看(过去 30 天)
Pan
Pan 2012-5-29
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

采纳的回答

Image Analyst
Image Analyst 2012-5-29
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by