how to plot a unit step function
5 views (last 30 days)
Daniel kiracofe on 27 Nov 2016
Do you want to do this numerically or symbollically?
With the symbolic math toolbox, the heaviside() function is a unit step. https://www.mathworks.com/help/symbolic/heaviside.html
If you want to do it numerically, you'll need to create it yourself, but it's easy. First create a time vector. e.g. t=-2:0.001:2 then create a zero vector for u, and fill in as appropriate: u = zeros(1,length(t)); u(find(t>0)) = 1; As u here is a vector not a function, you'd have to create a separate vector for the shifted step u(t-1).