
% Lab 10 Solutions
% CS 1109, Summer 2011
% July 28


function elapsed = negativeVec(im)
%
% negativeVec: This function displays the negative of an image
%
%   This function displays the negative of an input image (passed in as a
%   uint8 array). The negative is computed using vectorized code. The time
%   taken to invert the image is returned.
%

tic;

im = 255 - im; % inverts the image element-by-element

elapsed = toc;

imshow(im);

end

