How to create a 3D plot and split the values inside?

1 次查看(过去 30 天)
Let´s say I have 3 coordinates, x,y and z
x goes from 0 to 120 with a step of one
y goes from 0 to 200 with a step of one
z goes from -25 to 25
The values inside vary, for example:
vector = ( x, y , z)
2.5 = ( 10, 22, -5 )
How can I later make divisions on this data based on the value of the vector or values inside the entire matrix.
Something like the image above.

采纳的回答

darova
darova 2020-2-27
Use logical operations
id = vector > 2.5;
plot3(x(ix),y(ix),z(ix),'.r') % plot only points where vector > 2.5
  12 个评论
Mariana
Mariana 2020-3-16
How can I create a function based on the created plane?
darova
darova 2020-3-16
Can you be more specific? What plane? Show it on the picture

请先登录,再进行评论。

更多回答(1 个)

Mariana
Mariana 2020-3-16
  1 个评论
darova
darova 2020-3-16
Sure. Use scatteredInterpolant
p = isosurface(X,Y,Z,val,2);
xx = p.vertices(:,1);
yy = p.vertices(:,2);
zz = p.vertices(:,3);
patch(p,'facecolor','b','edgecolor','none')
F = scatteredInterpolant(yy,zz,xx); % Function of a plane (Y,Z)
Example of using
x1 = F(90,4)
plot3(x1,90,4,'oy')
Result

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by