function sys_augmented = output_state_augmentation(sys, n)
    arguments
        sys ss
        n (1,1) double {mustBeInteger,mustBeNonnegative}
    end
    yidx = startsWith(sys.OutputName, output_name);
    ny = sum(yidx);
    nz = size(sys, 1) - ny;

    A = blkdiag(sys.A, zeros(n));
    B = blkdiag(sys.B, eye(n));
    C = blkdiag(sys.C, eye(n));
    D = sys.D;

    sys_augmented = ss(A, B, C, D, InputName=sys.InputName, OutputName=sys.OutputName, TimeUnit=sys.TimeUnit);
    sys_augmented.UserData = sys.UserData;
end
