What is the solution, but without a Matlab program?
For the turbulent flow, the Colebrook equation provides to calculate the friction factor: 1/āf = -2log((ε/D)/3.7 + (2.51/(Reāf))).
Given: ε = 1.23x10^-5, D = 0.005, V = 40, and ν = 0.0015.
Using any learned numerical method (Bisection or Newton Raphson or Secant method) to determine the friction factor.
Note: Using the formula f = 0.316(Re)^0.25 for the initial guess of the friction factor.