Hi to all.
I have try to write a simple code for step and impulse response of a transfer function.
The code is this:
[num, den] = suspension(240, 16e3, 980, 36, 160e3);
G_s = tf(num, den);
figure('name', 'Bode plot of Suspentions Transfer Function');
h = bodeplot(G_s);
grid;
p = getoptions(h);
p.FreqUnits = 'Hz';
setoptions(h, p);
clear h p;
figure('name', 'Step and Impulse response');
subplot(211);
step(G_s);
grid;
subplot(212);
impulse(G_s);
grid;
And the output of suspension(240, 16e3, 980, 36, 160e3) is:
num = [0.0612 1]
den = [3.375e-06 0.0001057 0.0167 0.0612 1]
The problem is that in the Command Window the code works, but in my program - with no other command, no. The error is when I call 'step' and is:
Error using subsindex
Function 'subsindex' is not defined for values of class 'tf'.
Thank you in advance, Giacomo.