Gradient of a 2D plot
이전 댓글 표시
I have a 2D plot of potential (V) (circular contour plot). I have to find the electric field (E) by taking the gradient. How is it possible to see the gradient of V. [U,W]=gradient(V) returns the gradient in X and Y direction and quiver(X,Y,U,W) helps to visualize the vector field. How is it possible to view effective gradient. Contour (X,Y,U) will only help me to see gradient in x direction. How can I see the effect of gradient which is a vector sum of both gradient in X and Y.?
댓글 수: 2
Ameer Hamza
2020년 9월 30일
What is wrong with quiver. It generates arrows in the gradient direction.
Prince Alex
2020년 9월 30일
채택된 답변
추가 답변 (1개)
KSSV
2020년 9월 30일
M = sqrt(U.^2+W.^2) ;
contour(X,Y,M)
댓글 수: 1
Prince Alex
2020년 9월 30일
편집: Prince Alex
2020년 9월 30일
카테고리
도움말 센터 및 File Exchange에서 Vector Fields에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!