Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% B-field of a Wire
- % Calculates the magnitude, x-component, and y-component of a B-field from
- % a wire carrying an electrical current. There is a script file under a similar
- % on my page
- function [mag, Bx, By] = wireBfield(I, x, y)
- mu0 = (4*pi)*10^-7; %[T*m/A] Vacuum Permeability
- r = sqrt(x^2+y^2);
- mag = mu0*I/(2*pi*r);
- Bx = y*mag/r;
- By = x*mag/r;
- end
Add Comment
Please, Sign In to add comment