function y = wkeep1(x,len,varargin)
%MATLAB Code Generation Library Function

%   Limitations:
%   * Always returns a row vector unless x is a fixed-length or
%     variable-length column vector (m-by-1 or :-by-1).

%   Copyright 1995-2020 The MathWorks, Inc.
%#codegen

narginchk(2,4);
coder.internal.prefer_const(varargin);
nx = coder.internal.indexInt(length(x));
if nargin < 3
    opt = 'c';
else
    if isStringScalar(varargin{1})
        opt = char(varargin{1});
    else
        opt = varargin{1};
    end
end
if nargin < 4
    side = '0';
else
    if isStringScalar(varargin{2})
        side = char(varargin{2});
    else
        side = varargin{2};
    end
end
[first,last] = wkeepFirstLastIndex(nx,len,opt,side);
y = x(first:last);



