title: Replace Nan by a number in a cell array with Matlab
body: <pre><code>a = { [5 5 5 6 ] [ Nan Nan Nan Nan]; [ 7 8 8 8 ] [1 2 3 5] }
  </code></pre>
  
  <p>i want to replace <code>a{1,2}</code> by <code>[1 1 1 1 ]</code></p>
  
  <p>Is it possible? because I tried this function:</p>
  
  <pre><code>function k = non(a)
  [l ,c ] = size(a);
  
  for i= 1 : l
  
    for j =1 : c
       if a{i,j} == [ NaN NaN NaN NaN ]
            k{i,j} = [ 1 1 1 1] 
       else
            k{i,j} = a{i,j} ;
       end
    end
  end
  end
  </code></pre>
  
  <p>but it doesn't work.</p>