title: How to perform power() function on RGB matrix in matlab
body: <p>In a project, I need to perform power() function on RGB matrix in a matlab GUI program, but matlab keeps returning error meesage. 
  Below is the code and the error message</p>
  
  <pre><code>img_src = getappdata(handles.figure_pjimage, 'img_src');
  R=img_src(:,:,1);
  G=img_src(:,:,2);
  B=img_src(:,:,3);
  C = 12;
  gamma = 0.8;
  R1 = C * power(R, gamma);
  G1 = C * power(G, gamma);
  B1 = C * power(B, gamma);
  R2 = power((R1 / C), (1/gamma));
  G2 = power((G1 / C), (1/gamma));
  B2 = power((B1 / C), (1/gamma));
  disp(max(R2));
  new_img = cat(3,R2,G2,B2);
  axes(handles.axes_dst);
  imshow(new_img);
  </code></pre>
  
  <p>And here is the error message</p>
  
  <pre><code>Integers can only be raised to positive integral powers.
  </code></pre>
  
  <p>However, when I try to use power() function in command window, this can be done.</p>
  
  <pre><code>&gt;&gt; A = [2,2
  2,2]
  
  A =
  
       2     2
       2     2
  
  &gt;&gt; power(A,0.4)
  
  ans =
  
      1.3195    1.3195
      1.3195    1.3195
  </code></pre>
  
  <p>Please tell me if any of you get the solution, thanks.</p>