SPFUN

 

 Apply a function only to the nonzero entries.

  F = SPFUN('fun',S) evaluates fun(s) on the nonzero elements of S.

  e.g. F = SPFUN('exp',S) has the same sparsity pattern as S

  (except for underflow), whereas EXPMO9OU2(S) has 1's where S has 0's.