Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Can experts have some words of wisdom to get me things please:

Status
Not open for further replies.

tamoor

Newbie level 6
Joined
Apr 5, 2011
Messages
13
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,342
function PowerAllo= waterfillingPowerAllo(Ptot,eigenVec)
eigenVec=eigenVec+1e-10;
eigenVec=eigenVec:));
[sortedEigVec,oriPosition]=sort(eigenVec);

EigVecTemp=sortedEigVec;

begin=1;
while sum((EigVecTemp-EigVecTemp(1)*ones(length(EigVecTemp),1))./(EigVecTemp*EigVecTemp(1)))>Ptot
EigVecTemp=EigVecTemp(2:length(EigVecTemp));
begin=begin+1;
end

P1=(Ptot-sum((EigVecTemp-EigVecTemp(1)*ones(length(EigVecTemp),1))./(EigVecTemp*EigVecTemp(1))))/length(EigVecTemp);
for i=1:begin-1
PowerAlloOrdered(i)=0;
end

PowerAlloOrdered(begin)=P1;

for i=2:length(EigVecTemp)
PowerAlloOrdered(begin+i-1)=P1+(EigVecTemp(i)-EigVecTemp(1))/(EigVecTemp(i)*EigVecTemp(1));
end

for i=1:length(eigenVec)
PowerAllo(oriPosition(i))=PowerAlloOrdered(i);
end

sumCapa=0;
for i=1:length(eigenVec)
sumCapa=sumCapa+log2(1+PowerAllo(i)*eigenVec(i));
end

mu=P1+1/EigVecTemp(1);
capacity=sum(log2(mu*EigVecTemp));

, i got this from a website: i need to know how to use function: can any one make some example code and post please.
cheers :
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top