fplot behavior at breakpoints
显示 更早的评论
When using fplot to draw a function that has breakpoint, sometimes two sides of it are connected, but sometimes they are not. Why? Can I control them to be connected or not?
For example, run the following code:
syms x
fplot(tan(x), 'ShowPoles', 'off')
There's a line connecting
and
, but no line connecting
and
.
and
, but no line connecting
and
.
采纳的回答
更多回答(2 个)
Walter Roberson
2024-10-20
0 个投票
You can increase the likelyhood of the line being shown if you increase the MeshDensity . However, you should expect it to miss the poles if the equation is steep enough.
埃博拉酱
2024-10-20
0 个投票
fplot假设函数是连续的,所以你不能指望它正确作出有间断点的函数图像。
推荐尝试我专门为这种情况编写的二维函数作图工具
3 个评论
Walter Roberson
2024-10-20
Approximate translation:
fplot assumes that the function is continuous, so you can't expect it to correctly plot functions with discontinuities.I recommend trying the 2D function plotting tool I wrote specifically for this situation.
Walter Roberson
2024-10-20
fplot does not assume continuity.
If you look at the Tips section of fplot (symbolic) then you see
- If fplot detects a finite number of discontinuities in f, then fplot expands the range to show them.
which is an explicit statement that discontunities will (attempt) to be detected.
埃博拉酱
2024-10-21
Oh, I didn't look at sym's fplot, just the generic fplot documentation.
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
