plot 2D implicit function

版本 1.0.0.0 (1.8 KB) 作者: Ke Yan
a simple program to plot 2D implicit functions
553.0 次下载
更新时间 2013/11/11

查看许可证

[ img ] = drawImplicitFun( f,xRange,yRange,grid )
This is simple program to plot a implicit function F on IMG
F is a function handle with two variables
IMG is a binary image containing the plot of F=0.
example:
f = @(x,y)cos(x)+cos(y)-cos(x.*y);
img = drawImplicitFun(f,[-10,10],[-10,10],0.05);
figure, imshow(img)
note:
1. The program makes use of the fact that if function f is continuous in [a,b] and f(a)*f(b)<=0, then there exists a point p between [a,b] s.t. f(p)=0. So if there are singularity points, the plot may be wrong. If the zero point is not on the grid, this program may not show all the zero points, e.g. when the function value changes too fast, or the zero point is also a minimum point. But in most cases, this program is OK.
2. Sometimes the image shown by imshow containa unexpected dash lines (which should have been continuous). This may be caused by interpolation methods of imshow. Try to zoom the image.
3. If you want a plot of several implicit functions, just use the OR operator on several images.

引用格式

Ke Yan (2024). plot 2D implicit function (https://www.mathworks.com/matlabcentral/fileexchange/44260-plot-2d-implicit-function), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Line Plots 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0