errors with quiver!
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello there,
...hopefully my intentions with the input below is understood. What exact changes should I consider with line 4 or 5? There's always an error issue here. Thanks, I'm new to this.
spacing = 0.2;
[X,Y] = meshgrid(-2:spacing:2);
Z = X.*exp(-X.^2 - Y.^2);
[DX,DY,DZ] = gradient(Z,spacing);
quiver(X,Y,Z,DX,DY,DZ)
hold on
contour3(X,Y,Z)
axis equal
hold off
댓글 수: 0
답변 (1개)
KSSV
2022년 6월 19일
spacing = 0.2;
[X,Y] = meshgrid(-2:spacing:2);
Z = X.*exp(-X.^2 - Y.^2);
[DX,DY] = gradient(Z);
quiver(X,Y,DX,DY)
hold on
contour(X,Y,Z)
axis equal
hold off
참고 항목
카테고리
Help Center 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!