Hi,
The size of X-axis data and Y-axis data is not the same in the 'plot' command of the above code snippet. As I understand for this plot command:
"plot(k0Img,modulo)"
It should be a horizontal line parallel to X-axis. The proper command should be like the following:
plot(k0Img,modulo*ones(size(k0Img)))