Skip to main content
Source Link
corey979
  • 24.3k
  • 7
  • 60
  • 105

Simplify`PWToUnitStep:

f[z_] := Piecewise[{{0, 0 < z < 30}, {1, 30 < z < 60}, {0, 60 < z < 120}, {-1, 120 < z < 150}}]

Simplify`PWToUnitStep@f[z]

-(1 - UnitStep[120 - z]) (1 - UnitStep[-150 + z]) + (1 - UnitStep[30 - z]) (1 - UnitStep[-60 + z])

Post Made Community Wiki by corey979