Code covered by the BSD License  

Highlights from
Power System State Estimation using WLS

from Power System State Estimation using WLS by PRAVI
Power System State Estimation using Weighted Least Square Method

bbusppg(num) % Returns B-bus..
% Line Data for B-Bus (Shunt Admittance)Formation.

function bbus = bbusppg(num)     % Returns B-bus..

linedata = linedatas(num);
fb = linedata(:,1);
tb = linedata(:,2);
b = linedata(:,5);
nbus = max(max(fb),max(tb));    % no. of buses...
nbranch = length(fb);           % no. of branches...
bbus = zeros(nbus,nbus);

 for k=1:nbranch
     bbus(fb(k),tb(k)) = b(k);
     bbus(tb(k),fb(k)) = bbus(fb(k),tb(k));
 end

Contact us at files@mathworks.com