% A simple function to demonstrate iterative solution
% 
% Samuli Siltanen February 2014

function result = iterfun(z)

% Initialize the result
result = zeros(size(z));

% Perform the swap
result(1) = z(2);
result(2) = z(1);