I have created a chessboard function that goes from values 1 to -1, where its parameters are M (width of the image), N (height), F (rows), C (columns).
My problem is that for certain values of F and C, the function does not respond to me as it should, resulting in something similar to bands instead of squares. I have reviewed the Matlab documentation and have only seen the checkerboard function, which in my case is not worth it. The code of my function is shown below:
function [a] = chessboard3(N,M,C,F)
L1 = floor(M/C);
L2 = floor(N/F);
k = 1;
The resolutions that I must prove are:
8k = 7680x4320
4k = 3840x2160
1080p = 1920x1080
Thank you very much in advance.