Getting rid of odd rows:
new = image(2:2:end, :);
Getting rid of odd columns:
new = image(:, 2:2:end);
Instead of "n=mod(row, 2)==1", try "if mod(row, 2)==1". You also might want to use "row" instead of "n" in the next line. Also, don't forget to end that if statement.
function [ new ] = pixel( image )
[r,c]=size(image);
for row=1:r
n=mod(row,2)==1
new(n,:)=[];
end
end
Basically, I'm trying to get rid of every odd column. What's wrong with this formula?