title: Error using fzero in Matlab: Undefined function or method 'det' for input arguments of type 'function_handle'
body: <p>I have the same kind of problem described in this topic:
  <a href="https://stackoverflow.com/questions/6074062/using-fzero-undefined-function-or-method-isfinite-for-input-arguments-of-type/6135016#6135016">Using fzero: Undefined function or method &#39;isfinite&#39; for input arguments of type &#39;sym&#39;</a></p>
  
  <p>Their answers really helped me, but I am still stuck.</p>
  
  <p>I also have to find the zeros of a function of w, this function is defined in several steps:</p>
  
  <p>So the only unknown is w, and I defined other objects such as:</p>
  
  <pre><code>lambda= @(w) ((16*rho(i)*A(i)*w^2*Lprime(i)^2)/(E(j)*I(i)))^0.25;
  
  beta=@(w) lambda*b(i)^0.5;
  
  gamma=@(w) lambda*Lprime(i)^0.5;
  </code></pre>
  
  <p>Then, I define a 4*4 matrix M2:</p>
  
  <pre><code>M2=@(w) [besselj(4,beta) bessely(4,beta) besseli(4,beta) besselk(4,beta);
                 besselj(3,beta) bessely(3,beta) besseli(3,beta) -besselk(3,beta);
                 besselj(2,gamma) bessely(2,gamma) besseli(2,gamma) besselk(2,gamma);
                 besselj(4,gamma) bessely(4,gamma) besseli(4,gamma) besselk(4,gamma)];
  </code></pre>
  
  <p>Then the equation to be solved is: det(M2)=0. But w=0 is one of the solutions, and I want the first non-zero solution, so I wrote:</p>
  
  <pre><code>delta = @(w) det(M2);
  
  S(i,j)=fzero(delta,500);
  </code></pre>
  
  <p>Then I run the program, and Matlab says:</p>
  
  <pre><code>??? Error using ==&gt; fzero at 235
  FZERO cannot continue because user supplied function_handle ==&gt; @(w)det(M2)
  failed with the error below.
  
  Undefined function or method 'det' for input arguments of type 'function_handle'.
  
  Error in ==&gt; frequencies at 57
      S(i,j)=fzero(delta,500);
  </code></pre>
  
  <p>I also tried with the subs and the eval methods, and they don't work either, the error messages are in those cases:</p>
  
  <pre><code>??? Undefined function or method 'isfinite' for input arguments of type 'sym'.
  
  Error in ==&gt; fzero at 323
      elseif ~isfinite(fx) || ~isreal(fx)
  
  Error in ==&gt; frequencies at 58
      S(i,j)=fzero(@(w) subs(delta,'w',w),500);
  </code></pre>
  
  <p>Which is the same error as edio's I guess. And:</p>
  
  <pre><code>??? Error using ==&gt; fzero at 307
  FZERO cannot continue because user supplied function_handle ==&gt; @(w)eval(delta)
  failed with the error below.
  
  Undefined function or method 'eval' for input arguments of type 'function_handle'.
  
  Error in ==&gt; frequencies at 59
      S(i,j)=fzero(@(w)eval(delta),500);
  </code></pre>
  
  <p>Can you help me please?</p>