# Question about how the isosurface function works

5 ビュー (過去 30 日間)
Kaustubh Panse 2022 年 9 月 20 日
コメント済み: Kaustubh Panse 2022 年 9 月 20 日
Hi All,
I'm currently working on trying to write some code to plot an isosurface, and I had a basic question about how the isosurface works.
Let say I want to plot an isosurface with isovalue = 1. However, my data doesn't have any value which is exactly = 1.00000. The data is something like 0.9899, 1.0129, etc. So theoretically my isosurface should be blank right, because I don't have any value which is exactly = 1.0000. Yet I do get an output, which is also reasonable according to my data.
I was wondering what's the in built tolerance the code has? Does it perhaps plot an isosurface for points 1.000 +- 0.001? Furthermore, can I know and control the tolerance value to which the isosurface is plotted at?
Any help would really be appreciated!
Thanks!

サインインしてコメントする。

### 採用された回答

John D'Errico 2022 年 9 月 20 日

isosurface cannot use interpolation? Why not? All that is necessary is the ability to perform LINEAR interpolation, between pairs of points, nothing more.
For example, how does a contour plot work? Again, even though you do not have specific data points at a SPECIFIC level, you can still generate a contour plot. For example:
[X,Y] = meshgrid(0:.25:2);
Z = X.^2+Y.^2;
contour(X,Y,Z,[1 1])
grid on
hold on
plot(X,Y,'.')
Do you see that the contours are actually straight line segments between a set of points? As well, do you see those segments need not fall on the grid itself? The line segments cross between pairs of points. We can get the contour itself, as the points:
CXY = contourc(0:.25:2,0:.25:2,Z,[1 1])
CXY = 2×9
1.0000 1.0000 0.9643 0.8571 0.7500 0.6500 0.5000 0.2500 0 8.0000 0 0.2500 0.5000 0.6500 0.7500 0.8571 0.9643 1.0000
Read the help for contourc to see what was produced.
A simple linear interpolation is all that is necessary. And what is an isosurface, but a contour plot, in THREE dimensions?
##### 2 件のコメント表示非表示 1 件の古いコメント
Kaustubh Panse 2022 年 9 月 20 日
Hi John,
Thanks again!

サインインしてコメントする。

### カテゴリ

Find more on Scalar Volume Data in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by