title: How to replace all Inf values in a cell array with NaN?
body: <p>I have a <em>2</em>-by-<em>54</em> cell array in Matlab. Occasionally, the second row contains some <code>Inf</code> values. I'd like to convert all <code>Inf</code> values to <code>NaN</code> values and tried using this code:</p>
  
  <pre><code>dataC(cellfun(@isinf, dataC, 'UniformOutput', false)) = {NaN};
  </code></pre>
  
  <p>where <code>dataC</code> is my cell array.</p>
  
  <p>However, when doing that I get the following error:</p>
  
  <blockquote>
    <p>Error using subsindex</p>
    
    <p>Function 'subsindex' is not defined for values of class 'cell'.</p>
  </blockquote>
  
  <p>How can I solve this problem?</p>