p=1.23;D=.005;V=40;mu=1.7910^-5;e=.0015;Re=pVD/mu;%reynolds number equation
f=@(x)(1/sqrt(x)+2log(e/(3.7D)+2.51/(Resqrt(x))));a=.008;b=.08;while abs(b-a)>1e-9c=(a+b)/2;if f(a)*f(c)<0b=c;elsea=c;endendfprintf('Root found: %.10f\n',c)fprintf('Function value at root %E\n',f(c))
MATLAB: Matlab unrecognized function or variable
unrecognized function or variable 'pvd'.
Best Answer