e_0 = 8.854e-12; %C^2/(N m^2)
windowMin = -3;%min([q(:).pos]);
windowMax = 3;%max([q(:).pos]);
pos = vertcat(q(:).pos)';
%plot(pos(1,:),pos(2,:),'LineStyle','None','Marker','o','MarkerSize',10,'MarkerFaceColor','b');
[X,Y] = meshgrid(linspace(windowMin,windowMax,100));
%Polarkoordinaten (allgemein)
[q(i).winkel, q(i).rAll] = cart2pol(X-q(i).pos(1),Y - q(i).pos(2));
E_feld = @(q,r) q ./ (4*pi*e_0*r.^2);
E_feldvec_x = @(E,winkel) E .* cos(winkel);
E_feldvec_y = @(E,winkel) E .* sin(winkel);
q(i).Ex_All = E_feldvec_x(q(i).EAll,q(i).winkel);
q(i).Ey_All = E_feldvec_y(q(i).EAll,q(i).winkel);
ExAll = ExAll + q(i).Ex_All;
EyAll = EyAll + q(i).Ey_All;
figure,streamslice(X,Y,q(i).Ex_All,q(i).Ey_All); hold on;
plot(q(i).pos(1),q(i).pos(2),'LineStyle','None','Marker','o','MarkerSize',10,'MarkerFaceColor','b');
xlim([windowMin windowMax]);
ylim([windowMin windowMax]);
%quiver(X,Y,q(i).Ex_All,q(i).Ey_All);
EAll = sqrt(ExAll.^2 + EyAll.^2);
%contourf(X,Y,EAll); hold on;
%colormap copper; colorbar;
streamslice(X,Y,ExAll,EyAll); hold on;
plot(pos(1,:),pos(2,:),'LineStyle','None','Marker','o','MarkerSize',10,'MarkerFaceColor','b');
xlim([windowMin windowMax]);
ylim([windowMin windowMax]);