New Text Document

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

buses = input('How many busses are in system = ');

disp (buses);

yBus = zeros(buses);
%disp(yBus);

for rows = 1:buses


for col = 1:buses

if rows~=col;

yBus (rows,col) = input ('Enter Values=');

yBus(rows,col)= -1 * yBus(rows,col);

end
disp(yBus);

end
end

for rows = 1:buses


for col = 1:buses

if rows==col;
yBus(rows,col) = input ('Enter Ref. Values=');
yBus(rows,col)= -1 * yBus(rows,col);
S=sum(yBus(rows,:));
yBus (rows,col) = -S;

end
end
end
disp('The Final yBus Matrix is-');
disp (yBus);

You might also like