Bug Plotting Heaviside Step Function
25 views (last 30 days)
Show older comments
I'd expect this:
fplot(@(t) (heaviside(t) - heaviside(t-1)), [-5 5]);
to show 1 between [0,1) and 0 elsewhere. Instead, I get a flat line of all zero. If I change the plot range:
fplot(@(t) (heaviside(t) - heaviside(t-1)), [-2 2]);
that creates the plot that I'd expect over that range.
Further exploration shows that this works:
fplot(@(t) (heaviside(t) - heaviside(t-1)), [-3 3.25]);
but this one does not:
fplot(@(t) (heaviside(t) - heaviside(t-1)), [-3 3.3]);
This looks like a bug in Matlab. Any ideas?
0 Comments
Answers (0)
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!