Search code examples
matlabmatrixsparse-matrix

How to insert matrix which had null elements in matlab?


I want to insert a matrix which had null elements in Matlab, How can I do that? for example consider this matrix:

R=[1,null,3,4,5 | 6,7,null,8,null | null,null, 9,10,11]

Note that:

  1. I separate columns by "|".
  2. R is kind of Sparse Matrix.
  3. These null values can't be zero or any special number.

Thanks for any help!


Solution

  • Have you tried NAN ? You may like to see the link http://www.mathworks.com/matlabcentral/answers/14663