Hello Mr Kazem. Back to work :)
--- Quote Start ---
the filter must pass dc but cut highband at 0.2 (of Fs)
the function fir1 that I used cuts off at 0.3 of Nyquist (i.e. 0.3/2 of Fs = 0.15 so is just right for single tone).
--- Quote End ---
1- I checked the frequency response of this filter using freqz. But it shows the cutoff frequency at 0.3 not 0.15.
2- Regarding the control of NCO, I just have this thought and please explain. If we control frequency as you suggest, suppose that the RF carrier is 0.2 and I tuned my radio to 0.1, the loop will push until it reaches 0.2, right? Will the loop span all the range from 0.1 to 0.2 to lock? Suppose there is another RF signal with carrier 0.15, don't you think it might lock on it while it's looking for 0.2? I just have this thought nagging on me for a while, I hope you explain it.
3- You told me that variable 'i' in the 'for' loop represents phase, why not time?
4- I attached a simulation of Costas Loop I found on MATLAB FileExchange. I hope you check it.