% Make your bug report count
%
% Report all the facts:
% Include all information that make it possible to fix the bug. 
% If you are not sure whether to state a fact or leave it out, state it.
% This information includes your operating system, Octave version, 
% exact error message or exact output.
% Give a short, specific, complete example:
% Avoid: pseudocode, uninitialized variables, calls to unattached scripts 
% or functions.
% Justify your expectations briefly:
% Although it might seem obvious to you, someone examining the problem 
% might not know what result you consider correct.

% 1# BUG: Incorrect result on "step()" function on the "control" package:
%   when plotting the continuous and discrete step responses, 
%   with the 'zoh', both plots need to match in common points
%   but they didn't with some sample periods.
%
% I found the problem in the following commands:
clear all
pkg load control
Gs = tf(1000,[1 20 10000])
figure(1); T=0.063148;  Gz = c2d(Gs,T); step(Gs,Gz);  % Plots don't match
figure(2); T=0.06314 ;  Gz = c2d(Gs,T); step(Gs,Gz);  % Plots don't match
figure(3); T=0.0631  ;  Gz = c2d(Gs,T); step(Gs,Gz);  % Plots don't match
figure(4); T=0.06    ;  Gz = c2d(Gs,T); step(Gs,Gz);  % Plots match
figure(5); T=0.05    ;  Gz = c2d(Gs,T); step(Gs,Gz);  % Plots match
pause;
%
% Even when the function is ran separately, the incorrect result is founded:
figure(1); hold off; T=0.063148;  Gz = c2d(Gs,T); 
step(Gs); hold on; step(Gz);  % Plots don't match
figure(2); hold off; T=0.06314 ;  Gz = c2d(Gs,T); 
step(Gs); hold on; step(Gz);  % Plots don't match
figure(3); hold off; T=0.0631  ;  Gz = c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots don't match
figure(4); hold off; T=0.06    ;  Gz = c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots match
figure(5); hold off; T=0.05    ;  Gz = c2d(Gs,T);
step(Gs); hold on; step(Gz);  % Plots match
%
% It's also strange that the last plot (no matter how many) uses only 
% one color (blue) and the legend only shows Gz. 
% In the previous figures the legend shows Gs (red) and Gz (blue).

% Informations about the system:
%----------------------------------------------------------------------
% Windows 10 Pro (64 bits)
% Intel(R) Core(TM) i5-8250U CPU @1.60GHz 1.80GHz
%----------------------------------------------------------------------
%
%----------------------------------------------------------------------
%GNU Octave Version: 5.2.0 (hg id: eb46a9f47164)
%GNU Octave License: GNU General Public License
%Operating System: MINGW32_NT-6.2 Windows 6.2  x86_64
%----------------------------------------------------------------------
%Package Name         | Version | Installation directory
%---------------------+---------+-----------------------
%            control *|   3.2.0 | ...\control-3.2.0
%----------------------------------------------------------------------

