Threshold for Subvolume of figure shown below

2 ビュー (過去 30 日間)
Lucas Junghans
Lucas Junghans 2020 年 5 月 22 日
回答済み: darova 2020 年 5 月 22 日
Hello dear readers,
I've got a problem:
I have a figure 7 and i want to create a subvolume around the area of the maximum. I thought the area should be around x: -1 to 1 and for z: 140 to 145. Therefor i want to create isosurfaces which color the border of the threshold red. But unfortunately i do not have an idea how to figure out the value of threshold. Furthermore im not even quite sure how to declare the NaN's.
I hope you can help me.
Have a good day, everyone
Lucas
limits = [-1,1,-1,1,140,145];
[Vsub.X,Vsub.Y,Vsub.Z,E_sub] = subvolume(V.X,V.Y,V.Z,E, limits);
threshold = 1;
E_sub_angle = angle(E_sub);
E_sub_abs = abs(E_sub);
E_sub_angle(E_sub_abs<=threshold) = [NaN];
figure(10)
p1 = patch(isosurface(Vsub.X,Vsub.Y,Vsub.Z,E_sub_angle, threshold),...
'FaceColor','red','EdgeColor','none');
isonormals(Vsub.X,Vsub.Y,Vsub.Z,angle(E_sub),p1);
p2 = patch(isocaps(Vsub.X,Vsub.Y,Vsub.Z,E_sub_angle, threshold),...
'FaceColor','interp','EdgeColor','none');
view(3);
axis tight;
daspect([1 1 0.4])
colormap(hsv)
camlight right;
camlight left;
lighting gouraud
xlabel('X-Sub')
ylabel('Y-Sub')
zlabel('Z-Sub')
  2 件のコメント
darova
darova 2020 年 5 月 22 日
  • I have a figure 7 and i want to create a subvolume around the area of the maximum
Is this correct?
Lucas Junghans
Lucas Junghans 2020 年 5 月 22 日
Yes. This is the area:)

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

回答 (1 件)

darova
darova 2020 年 5 月 22 日
Let X,Y and Z be your 3d matrices
ff = patch(isosurface(X,Y,Z,V,threshold));
v = ff.vertices; % extract data
[~,ix] = max(v(:,3)); % find maximum value of z
[x0,y0,z0] = deal(v(ix,1),v(ix,2),v(ix,3));
ind = (X-x0).^2 + (Y-y0).^2 + (Z-z0).^2 < 5^2; % find values closer to maximum R=5
plot3(X(ind),Y(ind),Z(ind),'.r')

カテゴリ

Help Center および File ExchangeVolume Visualization についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by