Plot the electric field distribution ?

62 ビュー (過去 30 日間)
Mary Jon
Mary Jon 2014 年 3 月 17 日
how Plot the electric field distribution above the contour ?
% Plot the electric field distribution
figure;
v_now;
[ex,ey]=gradient(v);
quiver(-ex,-ey); %Quiver command creates a plot, E=-grad(V), hence the negative sign
title('potential ')
how put contour in the same figure of electric field distribution?

採用された回答

Mischa Kim
Mischa Kim 2014 年 3 月 17 日
編集済み: Mischa Kim 2014 年 3 月 17 日
Use hold all before or after the first plot command:
quiver(...) % replace the dots with your data
hold all;
contour(...)
  4 件のコメント
Mary Jon
Mary Jon 2014 年 3 月 17 日
Thanks Mischa
the figure appear exactly as I want it
Mary Jon
Mary Jon 2014 年 3 月 27 日
can I making these Arrows of electric field distribution as continuous lines instead of Arrows intersect the contour? How can do that?

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

その他の回答 (1 件)

Antonio Cedillo Hernandez
Antonio Cedillo Hernandez 2020 年 4 月 21 日
Here you have the full MATLAB code explained (in spanish but the first comment is the code): https://www.youtube.com/watch?v=k9srU6aQfL0

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by