Why Does fplot() Show a Phantom Pole?

2 views (last 30 days)
Paul
Paul on 7 Nov 2021
Commented: Paul on 10 Nov 2021
Example of fplot() showing a pole where clearely one does not exist. I know I can get rid of the dased line with the ShowPoles option, but that would eliminate all of the vertical lines, even for actual poles should there be any. Any idea why fplot() can't handle such a seemingly simple function?
syms t real
s(t) = piecewise(t<-1,0, t>2,0, exp(-abs(t)))
s(t) = 
figure;
fplot(s(t),[-3 3])
  9 Comments
Walter Roberson
Walter Roberson on 10 Nov 2021
The second one about incorrect size also refers to some of the details about the problems when using piecewise() with to a File with optimization turned on, which is a messy complicated one.

Sign in to comment.

Accepted Answer

Chunru
Chunru on 8 Nov 2021
The default number of t points (23) is not big enough to show the details around t=0. Change it to a larger value.
syms t real
s(t) = piecewise(t<-1,0, t>2,0, exp(-abs(t)))
s(t) = 
fplot(s(t),[-3 3], 'MeshDensity', 200)
  3 Comments
Paul
Paul on 10 Nov 2021
MeshDensity seems to be working well for the cases I'm interested in. Thanks.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!