In: Electrical Engineering
If you want to use K as variable you should go for manually plotting the bode instead of using built-in bode function.
w=0:1:100;
K=1;
Gs= ((K*1i*w)+3)./(((1i*w)+2).*((1i*w)+3));
subplot(211);
semilogx(w,20*log10(abs(Gs)));
ylabel('Magnitude in dB');
grid on;
title('K=1');
subplot(212);
semilogx(w,angle(Gs)*180/pi);
ylabel('Phase angle in degrees');
xlabel('frequency in rad/s');
grid on;
figure();
K=2;
Gs= ((K*1i*w)+3)./(((1i*w)+2).*((1i*w)+3));
subplot(211);
semilogx(w,20*log10(abs(Gs)));
ylabel('Magnitude in dB');
grid on;
title('K=3');
subplot(212);
semilogx(w,angle(Gs)*180/pi);
ylabel('Phase angle in degrees');
xlabel('frequency in rad/s');
grid on;
figure();
K=3;
Gs= ((K*1i*w)+3)./(((1i*w)+2).*((1i*w)+3));
subplot(211);
semilogx(w,20*log10(abs(Gs)));
ylabel('Magnitude in dB');
grid on;
title('K=3');
subplot(212);
semilogx(w,angle(Gs)*180/pi);
ylabel('Phase angle in degrees');
xlabel('frequency in rad/s');
grid on;