I created a if elseif else loop using the circshift function to go through various shifts of a matrix (x from -1 to 1 and y from -1 to 1). I need to go through the various coordinate combinations and save each output in order for me to average them at the end, but I'm having trouble calling to the original function and defining the coordinate variables. This is what I have so far:
function img_out = img_filter(img_in)img_in = img_shift(img_out);a = img_in;b = img_out(a,0,1);c = img_out(a,0,-1);d = img_out(a,-1,-1);e = img_out(a,1,0);f = img_out(a,-1,0);g = img_out(a,-1,1);h = img_out(a,1,-1);i = img_out(a,1,1);p_avg = (a+b+c+d+e+f+g+h+i)./9end
Best Answer