function [features1 features2] = simExp(dim, gamma, lambda) % Generate feature matrix based on exponential distribution % Inputs: % 1. dim- number of features % 2. gamma - constant % 3. lambda - constant (if lambda >1, a lot of values = 0) % P(ith feature = 1) = gamma * exp(-lambda * i) % Output: % 1. features1 - feature matrix using class1 % 2. features2 - feature matrix using class2 for i= 1:dim classOne(i) = gamma * exp(-lambda * i); classTwo(dim-i+1) = classOne(i); end % populating features1 and features2 for i = 1:dim tmp = rand(); if(tmp <=classOne(i)) features1(i)=1; else features1(i)=0; end tmp = rand(); if(tmp <= classTwo(i)) features2(i)=1; else features2(i)=0; end end