Threshold for Subvolume of figure shown below

2 vues (au cours des 30 derniers jours)
Lucas Junghans
Lucas Junghans le 22 Mai 2020
Réponse apportée : darova le 22 Mai 2020
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 commentaires
darova
darova le 22 Mai 2020
  • 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 le 22 Mai 2020
Yes. This is the area:)

Connectez-vous pour commenter.

Réponses (1)

darova
darova le 22 Mai 2020
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')

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by