function f = section(f,n)
%SECTION  Create a single section DFILT object.
%   H = SECTION(F,N) creates a single section filter
%   object H from the N-th section of the filter object F.
%   F and H will be filter objects of the same type.
%
%   If N is a vector, H = SECTION(F,N) creates a filter
%   object H with the same structure as F, but with LENGTH(N)
%   sections. The sections in H are connected in the same way
%   as the sections in F.
%
%   EXAMPLE:     
%      b1 = [1 2 3]; b2 = 1:10; b3 = 1;
%      a1 = [1 1/2 1/3]; a2 = 1; a3 = [1 1/2];
%      F = df2t(b1,a1,b2,a2,b3,a3);
%      H = section(F,1); % H is a filter equal to the 1st section
%                        % of F.
%      G = section(F,[1 3]); % Create a new filter, G, with the 1st
%                            % and 3rd sections of F.

%   Author(s): R. Losada
%   Copyright 1988-2000 The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 2000/06/14 20:55:43 $ 

error(nargchk(2,2,nargin));

% Check to verify that the section requested exists
nsecs = nsections(f);
if max(n) > nsecs,
    error(['The input filter has only ',sprintf('%d',nsecs),' sections.']);
end

f.coefficients = {f.coefficients{n}};

