IEEE 4 machine system: Need help in computing the bus admittance matrix
Your Y-bus matrix needs to have dimension 6x6. 
If you're using matlab to determine the Ybus matrix, I'd suggest following these steps:


Calculate admittance vector Y at each line: 

Y = 1./(R+iX)

Convert the Y vector into a diagonal matrix 

Yd = diag(Y).

Determine the connection/incidence matrix A which is a n(branch)xn(bus) matrix. From your branch matrix, it should be

A = [1 -1 0 0 0 0; 0 1 0 0 -1 0 ; 0 0 0 0 1 -1; 0 0 1 -1 0 0; 0 0 0 1 0 -1] 
Y = A' * Yd * A  

Add the line susceptance to diagonal elements. You could use the below code for this part.

for jk  = 1:nbus
    j   = Bus(jk);
    fl  = find(Fbus == j); 
    if length(fl)~=0
        for jj=1:length(fl) 
            Y(j,j)=Y(j,j)+1j*B(fl(jj))/2
        end
    end
    tl  = find(Tbus == j);
    if length(tl)~=0
        for jj=1:length(tl) 
            Y(j,j)=Y(j,j)+1j*B(tl(jj))/2
        end
    end
end