Counitng the number of scatter points above a surface
古いコメントを表示
Hi All,
I am having some troubles and hoping someone out there much smarter with MATLAB than me can help.
The problem I have i

s;
- I have plotted some data as a 3D scatter plot.
- I have then plotted a surface which is a ‘limiting condition’ for the data I have.
- I need to count the number of data points that fall above and below the surface.
Is this something that can be done?
I have been reading up on slices and searching these forums for help but cant find anything close.
Any help is appreciated.
The code is;
採用された回答
その他の回答 (1 件)
Lukas Bystricky
2015 年 8 月 11 日
編集済み: Lukas Bystricky
2015 年 8 月 11 日
Can your surface be expressed as z = f(x,y)? If so for every scatter point (at position (x0,y0, z0)), you can do:
h = z0 - f(x0,y0)
If h > 0 your point is above the surface.
If you can't express your surface as z = f(x,y), you can use interp2 or something to get an approximation to z at any (x,y) and do the same as above.
3 件のコメント
Adam Bartle
2015 年 8 月 11 日
Lukas Bystricky
2015 年 8 月 11 日
編集済み: Lukas Bystricky
2015 年 8 月 11 日
You could try to use scatteredInterpolant to evaluate all your points. The process might look something like this:
F = scatteredInterpolant(x, y, z) % x, y and z can be unordered
Then for each point you could call:
z_surface = F(point_x, point_y);
Although this may take a while to run for 46752 points. If you're planning on doing this several times that might be an issue.
Adam Bartle
2015 年 8 月 12 日
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
