"Mohammad aljabarat" <medo_jb@hotmail.com> wrote in message <hqjrnr$mum$1@fred.mathworks.com>...
> please anyone help me :(
>
> Computing the electric field due to multiple point charges obeys
> Write a MATLAB function get_efield_points that accepts the charge magnitudes {q1,q2,…qn}, the desired location of the electric field intensity, and the cartesian coordinate vectors for each point charge in the system. The output of the function should return the electric field intensity vector E.

I will give just a little help, Mohammad, but not so much as to be unfair to your fellow students.
You're dealing with Coulomb's law here. Ask yourself this quesion. How much force does an electric charge q1 at a certain point P1 exert on a change q at another point P if their distance apart is d, and in what direction does this force point? The electric field around q1 is defined as the force that would be exerted at a point P containing a "test" charge q = 1. So phase one of your effort should be to derive a formula for the three components of the force exerted on a unit charge at point P = (x,y,z) from a charge q1 located at point P1 = (x1,y1,z1). You have to figure out from these seven quantities, x, y, z, x1, y1, z1, and q1, how far apart the points are and how Coulomb's force on the unit test charge splits up into three components along the three axes. That means you have to make use of the information about what direction the force is pointed in.
After you solve that, in phase two it's easy to generalize into an arbitrary number of charges q1 at P1, q2 at P2, etc. It's a simple matter of adding up all the components along each of the three directions and then computing the length of the resulting vector to get its "intensity"  that is, the electric vector's length.
As a last desperate measure you should follow Rune's good advice, particularly 6). There's no substitute for a careful reading of your textbook in a subject like yours.
Roger Stafford
