Plot the electric field distribution ?

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?

 Respuesta aceptada

Mischa Kim
Mischa Kim el 17 de Mzo. de 2014
Editada: Mischa Kim el 17 de Mzo. de 2014
Use hold all before or after the first plot command:
quiver(...) % replace the dots with your data
hold all;
contour(...)

4 comentarios

thanks Mischa Kim
electric field distribution appear in the figure as dot not as Arrow or appear small Arrow ,what I must do to make this Arrow appear large
Mischa Kim
Mischa Kim el 17 de Mzo. de 2014
Editada: Mischa Kim el 17 de Mzo. de 2014
Mary, use the scale parameter:
scale = 2; % double length of vectors
quiver(-ex,-ey,scale)
Thanks Mischa
the figure appear exactly as I want it
Mary Jon
Mary Jon el 27 de Mzo. de 2014
can I making these Arrows of electric field distribution as continuous lines instead of Arrows intersect the contour? How can do that?

Iniciar sesión para comentar.

Más respuestas (1)

Antonio Cedillo Hernandez
Antonio Cedillo Hernandez el 21 de Abr. de 2020

0 votos

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

Categorías

Más información sobre Vector Fields en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Mzo. de 2014

Respondida:

el 21 de Abr. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by