Files for the 2012 Webinar "Tips and Tricks - Getting Started Using Optimization with MATLAB"
20 Nov 2012
These are the files that were used for the demonstrations in the webinar.
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
% [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