how to store values in an array in a loop ??

i want to store values in an array in a loop , n then take its average , continously delete them as well after 10 frames of a video..........

回答 (1 件)

Victor
Victor 2011 年 5 月 21 日

0 投票

Dear Arooj,
I have written a simple code for you, you can adopt it to yours.
clc;clear;
array = [];
for i=1:1:5
array2=i;
array=[array; array2];
end
b=numel(array);
c=sum(array)/b
% for deleting after 10 frames you can put it in another loop
Good luck

質問済み:

2011 年 5 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by