function f=pdeeexpd(x,y,s,nx,ny,u,t,f)
%PDEEEXPD Evaluate an expression on edges.

%       A. Nordmark 12-21-94.
%       Copyright (c) 1994-98 by The MathWorks, Inc.
%       $Revision: 1.7 $  $Date: 1997/11/25 17:05:33 $

if isstr(f)
  ok=1;
  fold=f;
  thack=0;
  if ~isieee & any(isnan(t))
    % PARABOLIC and HYPERBOLIC probes with time=NaN for
    % explicit time dependence. On non-IEEE machines we still need to
    % return NaN.
    % Try to cause an evaluation error if "t" is present in expression.
    thack=1;
    t=NaN*ones(1,size(x,2)+2);
  end
  eval('f=eval(fold);','ok=0;');
  if thack & (~ok | (any(size(f)-[1 1]) & any(size(f)-size(x))))
    % Assume error was due to presence of "t", and return NaN.
    ok=1;
    f=NaN;
  end
  if ~ok
    errstr=sprintf( ...
      '%s\n\nIn expression:\n%s\nwhen evaluating boundary conditions.\n', ...
      lasterr,fold);
    error(errstr);
  end
  if any(size(f)-[1 1]) & any(size(f)-size(x))
    errstr=sprintf( ...
      '%s\n\nIn expression:\n%s\nwhen evaluating boundary conditions.\n', ...
      'Expression evaluates to wrong size',fold);
    error(errstr);
  end
end

if length(f)==1
  f=f.*ones(1,length(x));
end

