Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Heaviside function in matlab

  1. Sep 5, 2011 #1
    Dear Fellows
    I need to define a function "f" in matlab as
    f is a heaviside unit step function

    I did it as

    f = heaviside[abs(-4)]

    but it is not working as I required.
  2. jcsd
  3. Sep 5, 2011 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The "heaviside" function is part of the symbolic maths toolbox and as such, requires a symbolic argument. Therefore, you need to modify your expression thus:
    Code (Text):
  4. Sep 5, 2011 #3


    User Avatar
    Gold Member

    If it's required you write it yourself, you're going to have to give us your code if you want troubleshooting help.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Heaviside function matlab Date
Mathematica Cannot do the integral of the Hyper-geometric function? Mar 11, 2018
How to program this in Matlab Feb 28, 2018
Mathematica Cannot Plot This Function in Mathematica Feb 26, 2018
Matlab Dotting autonomous functions Jan 24, 2018
Mathematica Piecewise Function Jan 18, 2018