help matlab - "for" command

Status
Not open for further replies.

katvek

Newbie level 4
Joined
Feb 9, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,328
hello,

here it is my problem,

i have a loop ii=0:25 where it calculates the error(ii)=... A matrix with 26 values. After the end, the simulatedBER is calculated with simBER=error/N;

I want this calculation to be done 10 times, more precisely, the error(ii) to be calculated 10 times making 10 groups of 26 values, and then to take mean value of each 10 times calculated value. Then, the mean values are put in the simBER.


the original loop is:

for ii=0:26

----
error(ii)=...;

end

simBER=error/N;



Does anyone have idea how to make the new loop and the mean calculation?
 

Something like this...

Code:
err = zeros(1, 26);

for k = 1:1:length(err)
   for m = 1:1:10
      err(k) = err(k) + ....;
   end
   err(k) = err(k) / m;
end

simBER = err / N;
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…