Guest User

Untitled

a guest
Nov 17th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. testmat = {{0, 1, 3}, {2, 0, 0}, {2, 4, 1}};
  2. ReplacePart[testmat, {i_, i_} -> $MachineEpsilon /; # <= 0 &]
  3.  
  4. ReplacePart[testmat, Position[testmat, # <= 0 &]-> $MachineEpsilon]
Add Comment
Please, Sign In to add comment