Can someone please help me with this? I know the number of iterations and friction factor, but I am expected to turn the loop I did into a function like this and it should work but there is something a little wrong.
@Tony Rankin, removing the substance of your question once it has been answered is not the point of the forum. The questions and answers are preserved to provide help to others down the road who have a similar question. Could you be kind enough to restore the details of your question?
Out of memory. The likely cause is an infinite recursion within the program.
Error in newton (line 27)
if abs(f(x0)) < tol
Can someone please help me with this? I know the number of iterations and friction factor, but I am expected to turn the loop I did into a function like this and it should work but there is something a little wrong.
Colebrook equation
This is meant to be the derivative of the Colebrook equation. I hope I had input it correctly.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.