Changeset 14104


Ignore:
Timestamp:
12/07/12 09:58:13 (12 years ago)
Author:
jschierm
Message:

NEW: Add heaviside function for python.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/miscellaneous/MatlabFuncs.py

    r14095 r14104  
    9797        return a
    9898
     99def heaviside(x):
     100        import numpy
     101
     102        y=numpy.zeros_like(x)
     103        y[numpy.nonzero(x> 0.)]=1.
     104        y[numpy.nonzero(x==0.)]=0.5
     105
     106        return y
     107
Note: See TracChangeset for help on using the changeset viewer.