title: MAP must be at least 'm x 3 array' error in MATLAB
body: <p>I am trying to generate C code with the <em>MATLAB Coder</em>. The input to the function is an image that has been processed by <code>imread</code> within MATLAB. Since the output should be an <em>m x n x 3</em> array from <code>imread</code>, I am not sure why this error is being shown. The assertions at the start of the function are shown below. Following that is the <code>rgb2gray</code> which is the source of the error. </p>
  
  <pre><code>%#codegen
  
  assert(isa(IM, 'uint8'));
  assert(size(IM, 1) &lt; 100);
  assert(size(IM, 2) &lt; 100);
  assert(size(IM, 3) == 3);
  
  I_temp = rgb2gray(IM); 
  </code></pre>
  
  <p>The error report I seem to be getting is shown below: </p>
  
  <p><img src="https://i.stack.imgur.com/LPhZx.png" alt="Error Report"></p>
  
  <p>The outputs and inputs to the function are given below: </p>
  
  <pre><code>function [actual_lep_x, actual_lep_y, actual_rep_x, actual_rep_y, actual_lmp_x, actual_lmp_y, actual_rmp_x, actual_rmp_y, actual_lnp_x, actual_lnp_y, np_x, np_y] = Points( IM )
  </code></pre>
  
  <p>I can send over the <em>.m</em> file if anyone needs to compile it. </p>
  
  <p>Help will be much appreciated! </p>