These are the files that were used for the demonstrations in the webinar.
peaksCon(x)
function [c,ceq] = peaksCon(x)
%PEAKSCON Constraint function for optimization with PEAKSOBJ
% PEAKSCON(X) is the constraint function for use with PEAKSOBJ. X is of
% size M x 2
%
% Syntax
% [c,ceq] = peaksCon(x)
%
% See also peaksobj, peaks
% Copyright (c) 2012, The MathWorks, Inc.
% All rights reserved.
% Define nonlinear equality constraint
ceq = [];
% Define nonlinear inequality constraint
% x1^2 + x2^2 <= 3^2
c = x(:,1).^2 + x(:,2).^2 - 9;
% fmincon accepted input form is c(x) <= 0