title: Create a Function which returns -1 for empty matrix, 0 for scalar, 1 for vector, 2 for none of these
body: <p>I am not allowed to use <code>isempty</code>, <code>isscalar</code>, or <code>isvector</code>.</p>
  
  <p><strong>My code is :</strong></p>
  
  <pre><code> function a = classify(x)
   b = sum(x(:));
   c = sum(b);
   if c == 0
      a = -1;
   elseif length(x) == 1
          a = 0;
   elseif length(x) &gt; 1
          a = 1;
   else
        a = 2;
   end
  </code></pre>
  
  <p>I am getting error with input :</p>
  
  <pre><code> 0 1 0 0 0 1 1
   1 0 0 1 1 0 0
   1 1 0 0 1 1 1
   0 1 1 1 1 1 0
   0 1 0 1 0 1 0
   1 0 0 1 1 1 1
   0 1 0 0 0 0 1
  </code></pre>
  
  <p>Output for above input is 1  </p>
  
  <p>My Auto grader is giving the following error:</p>
  
  <blockquote>
    <p>Feedback: Your function made an error for argument(s) <code>[0 1 0 0 0 1 1;1 0 0 1 1 0 0;1 1 0 0 1 1 1;0 1 1 1 1 1 0;0 1 0 1 0 1 0;1 0 0 1 1 1 1;0 1 0 0 0 0 1]</code>
        Your solution is <em>not</em> correct.</p>
  </blockquote>