Write a Matlab program to calculate the electric field due to a line of charge of length 1m.
a) Describe the line of charge as a collection of point charges centered on the z-axis. (Select the distance between charges to be .001m)
b) Use Matlab and Coulomb's law to calculate the electric field value at any point (x,y,z) within 5 meters of the line of charge.
c) Calculate the electric scalar potential of that same line of charge.
d) Determine the E field from the scalar potential and Matlab's gradient function.