Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Electric Potential of a Point Charge
- % Calculates the electric potential of a point charge
- % As always notes are at the bottom of the code with any
- % clarifications.
- % Constants
- k = 8.99*10^9 %[N*m^2/C^2] Coulombs constant
- % Variables and inputs
- q = input('Point charge in Coulombs\n');
- r = input('Distance between the point charge and object in meters\n');
- % Equations and outputs
- V = k*q/r;
- fprintf('The electric potential is %e V', V);
- %{
- Under the assumption that there is one point charge creating an electric potential
- Not to be confused with potential energy of a system
- %}
Add Comment
Please, Sign In to add comment