Plot the electric field distribution ?

63 Ansichten (letzte 30 Tage)
Mary Jon
Mary Jon am 17 Mär. 2014
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?

Akzeptierte Antwort

Mischa Kim
Mischa Kim am 17 Mär. 2014
Bearbeitet: Mischa Kim am 17 Mär. 2014
Use hold all before or after the first plot command:
quiver(...) % replace the dots with your data
hold all;
contour(...)
  4 Kommentare
Mary Jon
Mary Jon am 17 Mär. 2014
Thanks Mischa
the figure appear exactly as I want it
Mary Jon
Mary Jon am 27 Mär. 2014
can I making these Arrows of electric field distribution as continuous lines instead of Arrows intersect the contour? How can do that?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Kategorien

Mehr zu Vector Fields finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by