fplot behavior at breakpoints
Afficher commentaires plus anciens
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
.
Réponse acceptée
Plus de réponses (2)
Walter Roberson
le 20 Oct 2024
0 votes
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.
埃博拉酱
le 20 Oct 2024
0 votes
fplot假设函数是连续的,所以你不能指望它正确作出有间断点的函数图像。
推荐尝试我专门为这种情况编写的二维函数作图工具
3 commentaires
Walter Roberson
le 20 Oct 2024
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
le 20 Oct 2024
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.
埃博拉酱
le 21 Oct 2024
Oh, I didn't look at sym's fplot, just the generic fplot documentation.
Catégories
En savoir plus sur Calculus dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
