Below I wrote a MATLAB codes for SDR USRP B, X and N series (note: This is not for E series):

 

Tested only for B series in the lab.

Also a file of received data will be saved at the receiver.

Receive  |||||  Transmitter