title: Insert text characters into image pixels
body: <p>I am looking for a code to insert characters into image with matlab.</p>
  
  <p>The <code>img</code> is my cover image and <code>msg</code> is my text. I get this error   </p>
  
  <pre><code>Error using ==&gt; bitset
  Operands to BIT Ops must be numeric.
  </code></pre>
  
  <p>But mine is numeric. It is not? How do I make it clear?</p>
  
  <pre><code>clear all;
  img=imread('img.jpg','jpg');
  msgopen=fopen('ramz.txt');
  msg=fread(msgopen);
  msgbin=dec2bin(msg);
  msgsize=size(msg);
  x=msgsize(1);
  msgsizebin=dec2bin(x,8);
  imgh=size(img,1);
  imgw=size(img,2);
  for i=1:imgh;
    for j=1:imgw;
      img(i,j)=bitset(img(i,j),msgbin(i,1));
    end
  end
  </code></pre>