MATLAB: Read a file upto certain character

text file

Hello I have a file which contains 1342400 bits means 10101010010……like this way,
I need to read this file upto 1341440 bits ,how to do so?
after this I need to take chunk of 8bit from this bit sequence and have to convert it in decimal value,separated by ,
like 11111111111111111111111…. i need to convert it in 255,255,255 this way
any help for my two queries

Best Answer

Joy
What u can do is...say ur given data set is in a file name test.txt where it has 26 characters..
do the following
txt=filered(test.txt);% now txt variable has all ur 26 chars,but u need first 16
so
new_txt=txt(1:16);
simple