control.Bode.mag_phase_system() is extremely slow due to the inverse operation currently used. Matlab diagonalizes the A matrix and a method making use of the Hessenberg form. See http://www.weizmann.ac.il/matlab/toolbox/control/ref/bode.html Algorithm section for hints.