MATLAB: Remez function not working

filtersremez

I am using the remez function in a Filter and impulse response exercise. It is however giving me an error "??? Index exceeds matrix dimensions." Below is the short code where the error is coming in:
N = 41; F = [0 F1 F2 1]; M = [0 0 1 1]; B = remez(N-1,F,M)
I am struggling to figure out what it is I am doing wrong

Best Answer

You have not told us what F1 and F2 are, so we cannot reproduce your problem.
But, something like:
N = 41;
F = [0 0.2 0.4 1];
M = [0 0 1 1];
B = remez(N-1,F,M);
will work.