MATLAB Answers

take mean of consecutive 5 values.

8 views (last 30 days)
RUCHI CHOUDHARY on 25 Sep 2019
i want to fix the size of vector that is 5 ,then for every iteration calculate the value and perform mean of these 1to 5 values ,when 5 values is full,in the 6 iteration the mean of values from 2 to 6 and so on,if the mean is less than 0.1 then the iteration is stop.
U and V are the matrix having random values.
for i=1:no_of_iteration % no_of_iteration is some input value
U=U-alpha*0.1; % U is matrix ,randomly assign value
V=V-alpha*0.1; % V is matrix ,randomly assign value
want to take the mean of 5 consecutive cost value ,and compare the value if less then 0.1 then stop iteration


Sign in to comment.

Answers (0)