xyzφデータ入力のgradient演算
조회 수: 7 (최근 30일)
이전 댓글 표시
채택된 답변
covao
2023년 3월 13일
이동: Atsushi Ueno
2023년 3월 15일
一様に分布していないデータの表面をプロットする例が、以下のドキュメントにあります。
x = rand(100,1)*16 - 8;
y = rand(100,1)*16 - 8;
r = sqrt(x.^2 + y.^2) + eps;
z = sin(r)./r;
xlin = linspace(min(x),max(x),33);
ylin = linspace(min(y),max(y),33);
[X,Y] = meshgrid(xlin,ylin);
f = scatteredInterpolant(x,y,z);
Z = f(X,Y);
z = sin(r)./r;
figure
mesh(X,Y,Z) %interpolated
axis tight; hold on
plot3(x,y,z,'.','MarkerSize',15) %nonuniform
figure
contour(X,Y,Z)
hold on
[fx,fy] = gradient(Z,0.1);
quiver(X,Y,fx,fy)
hold off
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 表面プロットとメッシュ プロット에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!