function [hfig,hax] = pdeinit
%PDEINIT Start PDETOOL from scripts.

%   Magnus Ringh 7-01-94, MR 11-07-94.
%   Copyright (c) 1994-98 by The MathWorks, Inc.
%   $Revision: 1.7 $  $Date: 1997/11/25 17:05:51 $

pde_fig=findobj(allchild(0),'flat','Tag','PDETool');
if ~isempty(pde_fig),
  pdetool('new');
else
  pdetool;
end
pde_fig=findobj(allchild(0),'flat','Tag','PDETool');
ax = findobj(allchild(pde_fig),'flat','Tag','PDEAxes');
set(pde_fig,'CurrentAxes',ax)
no = nargout;
if no>0
  hfig = pde_fig;
end
if no>1
  hax = ax;
end

