Something like this would do:(note that this requires Control System Toolbox).
P=pid(1)
PI=pid(1,1)
PD=pid(1,0,1)
PID=pid(1,1,1)
bode(P,PI,PD,PID)
legend('P','PI','PD','PID')
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!