MATLAB: Hello every one i am new to matlab and i would like to generate a matlab code witch convert a text file (.txt) into a bitstream o and 1. please please please can somebody help me

binarytext filevector of binary

convert a text file (.txt) into a bitstream 0 and 1

Best Answer

TheStringToEmbed = fileread('NameOfTextFileGoesHere.txt');
text_bits = reshape( (dec2bin( uint8(TheStringToEmbed), 8 ) - '0').', 1, []);