Hi all,
I am mew in matlab and I have to read a text and then make a vector with the binary value of their chars.

For example :
text = 'pr'
ascii = 1010000

I want to make a vector like that -->

My code is

function bits_vector = textbin(text)

text_ascii = uint8(text);
num = length(text_ascii)

bits_matrix = dec2bin(text_ascii,7)-'0';

len_vector = num*8

bits_vector = zeros(len_vector,1)

for i=1:len_vector
    bits_vector(i:(i+7)) = bits_matrix(i,:)

Any help ? Please

Thank you

it is hard