How to calculate average

85 views (last 30 days)
Hi. I have an equation below for which I need to calculate the average value for mu_o.
First, by calculating the sum of it, and secondly by dividing it with no of iterations, but I am unable to do it. Please help it's urgent!
I am doing for mu_o the same as I have calculated the average for EHH but I am not getting correct values.
rt=2;
NoB=1;
Pmax=100;
EHH(i)=0;
mu_o(i)=0[
for j=1:100000
mu_o(i)= mu_o(i)+ min((((exp(rt)-1)*NoB)./r),Pmax);
EHH(i)=EHH(i)+exp(ii*mu_o);
end
EHHH_avg(i)=(EHH(i))/100000;
mufix(i)=(1/ii)*log(EHHH_avg(i));
mu_o_avg(i)=(mu_o(i))/100000;
Epsilon=((mu_o_avg(i))/mufix(i));

Accepted Answer

Image Analyst
Image Analyst on 10 Jul 2019
Edited: Image Analyst on 10 Jul 2019
Did you try using sum()?
EHHH_avg = sum(EHH) / 100000;
  5 Comments
Dhawal Beohar
Dhawal Beohar on 21 Jul 2019
Thank you ! it's being great help...

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by