[ 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 (2026). plot 2D implicit function (https://jp.mathworks.com/matlabcentral/fileexchange/44260-plot-2d-implicit-function), MATLAB Central File Exchange. に取得済み.
MATLAB リリースの互換性
プラットフォームの互換性
Windows macOS Linuxカテゴリ
- MATLAB > Graphics > 2-D and 3-D Plots > Line Plots >
タグ
| バージョン | 公開済み | リリース ノート | |
|---|---|---|---|
| 1.0.0.0 |
