title: solution of an implicit equation with fzero on MATLAB
body: <p>I've been trying to solve this implicit equation by using <code>fzero</code> in MATLAB. File that holds the code is named as <code>"colebrook"</code> and I've typed so far is as below.</p>
  
  <pre><code>D = input('Please enter the pipe diameter in meters: ');
  V = input('Please enter the fluid velocity in m/s: ');
  rho = input('Please enter fluid density in kg/m^3: ');
  mew = input('Please enter fluid viscosity in kg/m*s: ');
  Re = D*V*rho/mew;
  
  eps = input('Enter absolute roughness in milimeters: ');
  eD = eps/(D*1000);
  
  a = fzero(colebrookfunc,0.1);
  fprintf(a);
  </code></pre>
  
  <p>Equation that I want to solve is kept in another m-file called <code>"colebrookfunc"</code>, and the code it contains is as below.</p>
  
  <pre><code>function F = colebrookfunc(x)
      F = x - 1./(-4 * log10(eD/3.7 + 1.256./(Re*x.^0.5))).^2;
  </code></pre>
  
  <p>When i run in i get this error(s):</p>
  
  <pre><code>??? Input argument "x" is undefined.
  
  Error in ==&gt; colebrookfunc at 2
  F = x - 1./(-4 * log10(eD/3.7 + 1.256./(Re*x.^0.5))).^2;
  Error in ==&gt; colebrook at 28
  a = fzero(colebrookfunc,0.1);
  </code></pre>
  
  <p>What is my mistake?</p>
  
  <p>Thank you.</p>