Answer:
Copy MATLAB code to plot the magnitude of magnetic field strength with respect to z on the axis of solenoid:
z=-20:0.01:20;
H=120.*(((20-(2.*z))./sqrt((20-(2.*z)).^2+100))+((20+(2.*z))./sqrt((20+(2.*z)).^2+100)));
plot(z,H)
title('plot of |H| vs z along the axis of solenoid')
ylabel('Magnitude of magnetic field 'H")
xlabel('position on axis of solenoid 'z")
Step-by-step explanation:
full explanation is attached as picture and the resultant plot also.