You're on the right track trying to use stepinfo. The stepinfo function returns a structure containing all the common step response metrics. You can directly plot the these results. Here is some example code to get you started:
s = tf('s');
G = 1/(s^2 + 5*s + 2);
[y,t] = step(G);
stepResults = stepinfo(y,t);
tSettle= stepResults.SettlingTime;
indexSettle = find(t >= tSettle,1,'first');
xSettle = t(indexSettle);
ySettle = y(indexSettle);
plot(t,y);
grid on;
hold on;
plot(xSettle,ySettle,'ro');
plot([0 xSettle],[ySettle ySettle],'g-.');
plot([xSettle xSettle],[0 ySettle],'g-.');
hold off;
You could easily repeat this same process for each step response metric of interest. Hope this helps!
Best Answer