MATLAB: Plotting binary data to NRZ signal Format

dec2bin nrz

i have a program like below :
a=dec2bin(n,8) . n is random input from 0 to 255. then i want to plot the result of 'a' into NRZ signal format. anyone can help me?

Best Answer

bits = reshape( (dec2bin(n,8) - '0').', 1, [] );
encoded_bits = unrz(bits)
Now you can plot the encoded bits