1 2 3 4 5 6 7 8 9 10 11 12
clear //Given m=0.2 //Kg I=2 //A l=1.5 //m g=9.8 //Calculation B=(m*g)/(I*l) //Result printf("\n Magnitude of the magnetic field is %0.2f T",B)