B0 =
Define the variable as a symbolic variable and then substitute -
syms Vpo Von Dp Dn ws Lp Cps Ll Lm Vsecm Isec_real Isec_imag Isec_abs Thetasec Ix_real Ix_imag Ix_abs Kp Kl Km real
%Kp = Lp * Cps * ws^2;
B0 = Cps^2*Ix_abs*Lp^3*ws^9*(- Lm*ws*Isec_abs^2 + Isec_imag*Vsecm*cos(Thetasec) + Isec_real*Vsecm*sin(Thetasec))
%Definition
syms Kp
%Substition
B0 = subs(B0, Lp * Cps * ws^2, Kp)