Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.8K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to translate probability Matlab code into Mathematica?

Posted 11 years ago
POSTED BY: John G
4 Replies
Posted 11 years ago

Thanks David for your answer..The mistake was exist in my last command as I forgot to take the mean of average probability!!!.

POSTED BY: John G
Posted 11 years ago

It would be good to know more about what is being analyzed. But when I execute your code this is what I get. Why do you believe this is incorrect?

M = 10^2;

h = Sqrt[2]*RandomReal[1, M] + I*RandomReal[1, M];

n = Sqrt[2]*RandomReal[1, M] + I*RandomReal[1, M];

No = Variance[n];

P = 10^(z/10);

a = P*(Abs[h])^2/No;

OutageProb = 1 - (Gamma[1, 1/a])^2;

LogPlot[OutageProb, {z, 0, 20}, PlotRange -> {10^-4, All}, 
 Frame -> True]

enter image description here

LogPlot[Mean[OutageProb], {z, 0, 20}, PlotRange -> {10^-4, All}, 
 Frame -> True]

enter image description here

POSTED BY: David Keith
Posted 11 years ago
POSTED BY: John G
Posted 11 years ago

I used Table i.o. a For loop and got this: the data gives 11 sets of numbers (one for each value of z) of which this is plot of the first two:

M = 10^2;
h = Sqrt[2]*RandomReal[1, M] + I*RandomReal[1, M];
n = Sqrt[2]*RandomReal[1, M] + I*RandomReal[1, M];
No = Variance[n];
data = Table[
   1 - (Gamma[1, 1/(10^(z/10)*(Abs[h])^2/No)])^2, {z, 0, 20, 2}];
ListLogPlot[data[[1 ;; 2]], Joined -> True, ImageSize -> 400, 
 AspectRatio -> 1]

enter image description here

Does this make any sense?

POSTED BY: Erik Mahieu
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard