%% Optimization Options
%% Specify the model

Mdl = arima('AR',0.5,'Constant',0,'Variance',1);
rng(1); % For reproducibility
y = simulate(Mdl,25);

%
%% Set the options

options = optimoptions(@fmincon,'Diagnostics','on',...
    'Algorithm','sqp','Display','off','ConstraintTolerance',1e-7)
% @fmincon is the function handle for fmincon

%
%% Estimate the model

Mdl = arima(1,0,0);
EstMdl = estimate(Mdl,y,'Options',options);

% Copyright 2012 The MathWorks, Inc.