# Plot electric potential distribution

81 ビュー (過去 30 日間)
Lisa Nguyen 2019 年 11 月 4 日 How do I plot electric potential distributions that look similar to this? I have already calculated the Electric potential as a 64x128 matrix (64 electrodes and 128 dipole sources) using V (r, θ)= p*cos(θ)/(4*pi*σ*r^2). I'm just confysed on what commands to use to plot the distriution.

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

### 回答 (1 件)

David Wilson 2019 年 11 月 5 日
Well I kind of get what you want, but you do seem to have a singularity at the origin when r=0.
p = 1; sig = 1; % constants that are still a mystery.
V = @(r,theta) min(max(p*cos(theta)./(4*pi*sig*r.^2),-1),1); % Need thresholding here.
npts = 1000;
r = linspace(-1,1,npts)';
phi = linspace(0,2*pi, npts)';
[R, Phi] = meshgrid(r,phi);
E = V(R,Phi);
[X,Y] = pol2cart(Phi,R);
contourf(X,Y,E)
colorbar
and this gives サインインしてコメントする。

タグが未入力です。

### Community Treasure Hunt

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

Start Hunting!