Looks ok to me except the filtering functions both rrc filters and loop filter need some change(Don't follow my wrong example, it was just for a start).
Matlab filter functions are based on convolution with previous samples (assumes zeros initially and towards the tail)
This means using filter function samplewise will get wrong (as it sees [zeros value zeros].
How to filter per sample inside the loop? basically I ended up with some trick that I don't remember now. It was based on giving the filter all previous values in the loop to compute a new sample and update this initial string each time. something like this:
y_f = filter(h,1,x(1:i));
I will try see my records this weekend while you try your efforts.
Your nco is right but may need reversal of error sense and that will show up as you ran your code.
loops are very slow in matlab so use shortest useful length.