MATLAB: How to get the bode plot in Hz for the IDFRD model in the System Identification Toolbox 7.4 (R2010a)

bodeidentificationplotsystemSystem Identification Toolbox

I need to plot a Bode plot of an IDFRD model with frequency units in Hz from within a script.By default the bode() command plots the frequency in rad/s for IDFRD models. The documentation describes how to choose Hz for frequency for the System Identification Toolbox GUI. But there is no discussion on how to change the frequency units when plotting from command line using the bode command.

Best Answer

To plot frequency response of system identification objects in hertz you can use the FFPLOT command. After using this command, you can use the 'XScale' property of an axis to set the X axis to log scale. The following code sample shows how to plot an IDPOLY object using the FFPLOT and modifying its axis to log.
A = [1 -1.5 0.7];
B = [0 1 0.5];
C = [1 -1 0.2];
m0 = idpoly(A,B,C);
ffplot(m0)
set(gca,'XScale','log')