MATLAB: How to Remove a Column and add it again

image

Hello
I want to remove first column from an Image and do some thing on Image and then add that column again. I want to remove a colum if the number of column is odd. _
The speed and Performance of solution is important for me._
Could you help me?
thanks

Best Answer

%copy original image (img) without first column if number of column is odd
newimage = img(:, 2-mod(size(img, 2), 2):end, :);
%do something with newimage
%??
%add back first column if size is odd.
newimage = [img(:, 1:mod(size(img, 2), 2), :) newimage];