How can I get the zero crossing contour of a matrix
20 次查看(过去 30 天)
显示 更早的评论
Hi,
I have a matrix of 201x201 size and it has a zero crossing. I am using contour3 to get the contour plot. but i actually need only the contour corresponding to zero values. the image it attached here.
any help would be highly appreciated.
Thank you.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1293445/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1293445/image.bmp)
0 个评论
采纳的回答
John D'Errico
2023-2-12
编辑:John D'Errico
2023-2-12
help contourc
For example:
v = linspace(-5,5,100);
[x,y] = meshgrid(v,v);
z = x.^2 - y.^2 + 1; % The contours will be hyperbolic
contour(x,y,z,[0,0])
C = contourc(v,v,z,[0 0])
There will be two contour lines found, each of which have 176 points in the piecewise curves generated.
So if you want the points along that contour itself, contourc does it. If you want to draw the contour, then I contour will do it easily enough.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!