function sys_rounded = round_coeff(sys, digits)
%TRUNCATE_COEFF Truncates model coefficients smaller in absolute value than threshold
    if isa(sys, 'ss')
        sys.A = round(sys.A, digits, 'significant');
        sys.B = round(sys.B, digits, 'significant');
        sys.C = round(sys.C, digits, 'significant');
        sys.D = round(sys.D, digits, 'significant');
        sys.E = round(sys.E, digits, 'significant');
    elseif isa(sys, 'tf')
        cellfun(@(x) round(x, digits, 'significant'), sys.Numerator);
        cellfun(@(x) round(x, digits, 'significant'), sys.Denominator);
    elseif isa(sys, 'zpk')
        sys.K = round(K, digits);
        cellfun(@(x) round(x, digits, 'significant'), sys.P);
        cellfun(@(x) round(x, digits, 'significant'), sys.Z);
    elseif ismatrix(sys)
        sys = round(sys, digits, 'significant');
    end
    
    sys_rounded = sys;
end