If you want to transmit and recieve a text file in MATLAB, you can use this code: %For text transmitter and receiver....
%TX
fid = fopen('BER_file.txt');
x=fread(fid,'*char');
bin_1=dec2bin(x,8);
bin_2=bin_1-'0';
leng=numel(bin_2);
ready_vector_to_tx=reshape(bin_2,leng,1);
%RX------------------
leng=length(ready_vector_to_tx);
RECEIVED_vector = reshape(ready_vector_to_tx,leng/8,8)
text_file_char=num2str(RECEIVED_vector,'%d')
text_1= bin2dec(text_file_char);
text_2 = char(text_1);