zz4fap

Untitled

Jun 13th, 2018
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.48 KB | None | 0 0
  1. clear all;close all;clc
  2.  
  3. M = 1;
  4.  
  5. d = 2;
  6.  
  7. p = 10;
  8.  
  9. numIter = 1000000;
  10.  
  11. %% -------------------- Problem 1: First option (l != k) ----------------------
  12. simulated = 0;
  13. for iter = 1:1:numIter
  14.     h= (sqrt(d))*(1/sqrt(2))*complex(randn(M,1),randn(M,1));
  15.        
  16.     w = (sqrt(1/p))*(1/sqrt(2))*complex(randn(M,1),randn(M,1));
  17.        
  18.     num = (h'*(h*h')*h);
  19.    
  20.     den = (h + w)'*(h + w);
  21.    
  22.     simulated = simulated + real(num/den);
  23. end
  24.  
  25. simulated = simulated/numIter;
Advertisement
Add Comment
Please, Sign In to add comment