title: Basic FreeMat/MATLAB syntax - dimension error
body: <p>I am using <a href="http://en.wikipedia.org/wiki/FreeMat" rel="nofollow">FreeMat</a>, and I have an <a href="http://en.wikipedia.org/wiki/RGB_color_model" rel="nofollow">RGB</a> picture which is a 3D matrix contains the columns and rows of the pictures and the RGB values for each pixel.</p>
  
  <p>Since there is not an intrinsic function to convert RGB picture to <a href="http://en.wikipedia.org/wiki/YIQ" rel="nofollow">YIQ</a>, I have implement one. I came up with this code:</p>
  
  <p>Assume I have a 3D array, <code>image_rgb</code>:</p>
  
  <pre><code>matrix = [0.299 0.587 0.114;
  0.596 -0.274 -0.322;
  0.211 -0.523 0.312];
  row = 1:length(image_rgb(:,1,1));
  col = 1:length(image_rgb(1,:,1));
  p = image_rgb(row,col,:);
  
  %Here I have the problem
  mage_yiq(row,col,:) = matrix*image_rgb(row,col,:);
  
  max_y = max (max(image_yiq(:,:,1)));
  max_i = max (max(image_yiq(:,:,2)));
  max_q = max (max(image_yiq(:,:,3)));
  
  %Renormalize the image again after the multipication
  % to [0,1].
  image_yiq(:,:,1) = image_yiq(:,:,1)/max_y;
  image_yiq(:,:,2) = image_yiq(:,:,2)/max_i;
  image_yiq(:,:,3) = image_yiq(:,:,3)/max_q;
  </code></pre>
  
  <p>I can't understand why the matrix multiplication fails. I want the code to be nice and not just to, multiply the matrix by hand...</p>