MATLAB Error! In an assignment A(I) = B, the number of elements in B and I must be the same : I'm new to MATLAB but after some studies and practice I was able to get going and there is this particular model I'm trying to analyze and plot using MATLAB. 

Unfortunatley I got stuck on K2 as it brought up this error  "***???  In an assignment  A(I) = B, the number of elements in B and
 I must be the same.***"
I ran the debugger and I found out that J4 alone was a vector while other variables were all scalar.

Please guys how can I resolve this error to have my plot?

Here is the code that I ran. 

    h1 = 1*10^-6;
    h2 = (10:10:1500)*10^-6;
    a = 62.5*10^-6;
    b = a+h1;
    c = b+h2;
    alpha_1 = 0.55*10^-6;
    alpha_2 = 17.2*10^-6;
    alpha_3 = 14.2*10^-6;
    zeta = 6.3*10^-6;
    P11 = 0.121; 
    P12 = 0.27;
    neff = 1.456;
    U1 = 0.17;
    U2 = 0.32;
    U3 = 0.31;
    E1 = 0.74*10^11;
    E2 = 1.08*10^11;
    E3 = 1.96*10^11;
    n = 1;
    while(n<=150)
    J1(n) = E2*(b^2-a^2)*(1-U1)-E1*a^2*(1-U2)-E1*b^2*(1+U2);
    J2(n) = 2*E1*b^2;
    J3(n) = E1*E2*(b^2-a^2)*(alpha_2 - alpha_1);
    J4(n) = 2*E3*(c(n)^2-b^2)*a^2;
    J5(n) = E2*(b^2-a^2)*(1-U3)*b^2+E2*(b^2-a^2)*(1+U3)*c(n)^2-E3*(c(n)^2-b^2)*(1+U2)*a^2-E3*(c(n)^2-b^2)*(1-U2)*b^2;
    J6(n) = E2*E3*(c(n)^2 - b^2)*(b^2-a^2)*(alpha_2-alpha_3);
    
    K1(n) = ((alpha_3-alpha_1)*E3*(c(n)^2-b^2)+(alpha_2-alpha_1)*E2*(b^2-a^2))/(E1*a^2+E2*(b^2-a^2)+E3*(c(n)^2-b^2));
    K2(n) = (J2*J6-J3*J5)/(J2*J4-J1*J5);
    
    Sr(n) = (neff^2/2)*(P11+P12)*(((1-U1)*K2/E1)-U1*K1);
    Sz(n) = (1+P12)*(K1-(2*U2*K2/E1));
    St(n) = alpha_1+zeta;
    Km(n) = St+Sz+Sr;
    
    n=n+1;
    end
    plot(h2,Km)