MATLAB: Plot the electric field distribution

contour

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?

Best Answer

Use hold all before or after the first plot command:
quiver(...) % replace the dots with your data
hold all;
contour(...)