%% Complex Contour Integration Using Waypoints
% Create the function f(z) = 1/(2z - 1).

fun = @(z) 1./(2*z-1);

%
% Integrate in the complex plane over the triangular path from 0 to 1+1i to 1-1i to 0 by specifying waypoints.

q = integral(fun,0,0,'Waypoints',[1+1i,1-1i])

% Copyright 2012 The MathWorks, Inc.