Example H3.2
Matlab code for example 3.2 from the book "Regeltechniek voor het HBO"
Determine the stepresponse in s-domain from a given pz-map
- Date : 28/07/2021
- Revision : 1.0
Copyright (c) 2021, Studieboeken Specialist Permission is granted to copy, modify and redistribute this file, provided that this header message is retained.
a) Determine response
in s-domain
Determine the response
in the s-domain from pz-map given in figure below: This could be the result of
where the system H1 and the input X1 are equal to: Visualize the steps above: response of proces H1 to input: 
Calculate and show the poles of 
% clear all variables from Workspace and close all figures
H1=5*(s+2)/((s+3)*(s+5));
zpk(Y1)
ans =
10 (s+2)
---------------
s^2 (s+5) (s+3)
Continuous-time zero/pole/gain model.
Define input parameters to show response to an x1=2*t input:
Tsim1=1; % Simulation time in seconds
% Simulate the response of system H1 to the input x1
title('Response to an input 2*t');
b) Determine response
in s-domain
Determine the response
in the s-domain from pz-map given in figure below: This could be the result of
where the system H2 and the input X2 are equal to: Visualize the steps above: response of proces H2 to input: 
Calculate and show the poles of 
H2=3*(s+6)/((s+1)*(s+4));
zpk(Y2)
ans =
15 s (s+6)
---------------------
(s+4) (s+1) (s^2 + 9)
Continuous-time zero/pole/gain model.
Define input parameters to show response to an x2=5*cos(3t) input:
Tsim2=7; % Simulation time in seconds
% Simulate the response of system H2 to the input x2
title('Response to an input 5*cos(3*t)');
Generate Matlab figure(s) for usage in the book
Init create Enhanced Figures
Close all the earlier enhanced figures with a certain tag
EnhancedFig = findobj(0, 'Tag', 'EnhancedImage');
Enhance the figures
set(gcf, 'Tag','EnhancedImage');
% create the pzmap plot again but now with a figure handle
% get the handle to the plot options
p.Title.String='PN beeld van \itY_1(s)';
% write the options to the figure
set(gcf, 'Tag','EnhancedImage');
% create the timeresponse plot again but now with a figure handle
% get the handle to the plot options
p.Title.String='Slope response \ity_1(t)';
% Make input invisible. If this does not work
% create the figure again with this code in an m-
% script and toggle with a right mouse click in
% the figure the input signal
% write the options to the figure
set(gcf, 'Tag','EnhancedImage');
% create the pzmap plot again but now with a figure handle
% get the handle to the plot options
p.Title.String='PN beeld van \itY_2(s)';
% write the options to the figure
set(gcf, 'Tag','EnhancedImage');
% create the timeresponse plot again but now with a figure handle
% get the handle to the plot options
p.Title.String='Sine response \ity_2(t)';
% Make input invisible. If this does not work
% create the figure again with this code in an m-
% script and toggle with a right mouse click in
% the figure the input signal
% write the options to the figure