title: Error while trying to remove an element from a struct field
body: <p>I have the following code in <code>matlab</code> and trying to remove an element from a struct: </p>
  
  <pre><code>function test()
      C = struct;
      C.(sprintf('Ck')) = [1 6 8 9; 8 6 9 7; 7 6 67 6; 65 7 8 7];
      ck_length = length(C.(sprintf('Ck')));
      for i=1:ck_length
          if C.(sprintf('Ck'))(i)&gt; 10
             cleared = rmfield(C.(sprintf('Ck')), C.(sprintf('Ck'))(i));
          end
      end
  end
  </code></pre>
  
  <p>But, when I run the program I get an error as shown below:</p>
  
  <pre><code>&gt;&gt; test
  ??? Error using ==&gt; rmfield at 19
  S must be a structure array.
  
  Error in ==&gt; test at 89
     cleared = rmfield(C.(sprintf('Ck')), C.(sprintf('Ck'))(i));
  </code></pre>
  
  <p>How can I solve this issue?</p>
  
  <p>Thanks.</p>