How to choose/change an isovalue

2 ビュー (過去 30 日間)
Sana Ahmed
Sana Ahmed 2020 年 4 月 13 日
編集済み: darova 2020 年 4 月 13 日
I have a script plotting eigenvectors using isosurface but I want to change the level that they are plotted on. As I have it now, it won't plot anything unless the isovalue is 0 (or if the temp array is flipped, then the isovalue must be n). How do I change this so that I can plot the vectors on different levels based on the content of the vector?
n = 15;
G = numgrid3d(n);
A = delsq3d(G);
m = n - 2;
p = m^3;
[V,D] = eigs(A,p);
vector = V(:,p-7);
vector = reshape(vector, [m,m,m]);
temp = (n/m:n/m:n);
x = zeros(m,m,m);
for i = 1:m
for j = 1:m
x(:,i,j) = temp(i);
end
end
y = zeros(m,m,m);
for i = 1:m
for j = 1:m
y(i,:,j) = temp(i);
end
end
z = zeros(m,m,m);
for i = 1:m
for j = 1:m
z(:,:,i) = temp(i);
end
end
figure(1)
plot = patch(isosurface(x,y,z,vector,0));
isonormals(x,y,z,vector,plot)
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 13 日
why not use ndgrid or meshgrid to create your x y z arrays?
Sana Ahmed
Sana Ahmed 2020 年 4 月 13 日
I hadn't thought of it, but I tried it an using meshgrid cuts down on a lot of code. Thanks!

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeScalar Volume Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by