blob: 9a474fa399577bb452a12c8f9ca01dfe0e02b558 (
plain)
1
2
3
4
5
6
7
8
9
10
|
//Example 18_2
clc();
clear;
//To find the magnitude of the magnetic field
m=1.67*10^-27 //Units in Kg
v=10^6 //Units in meters/sec
r=4*10^-2 //Units in Meters
q=1.6*10^-19 //Units in C or eV
b=(m*v)/(r*q) //Units in T
printf("The magnitude of magnetic field is B=%.4f T",b)
|