The help for pdeinit
is short: "Start PDETOOL from scripts." pdetool
, like most *tool
M-files from The MathWorks, is a GUI and the help/documentaion for it indicates as much.
I'm confused because, not only does pdeinit
open a figure window, but you're using it to return handles to the figure and axis of that figure. Your code then proceeds to manipulate those handles. You can't get those handles without first creating and opening a figure. Is the issue that you just want a regular figure window instead? If so, then you can replace [pde_fig,ax]=pdeinit;
with:
pde_fig = figure;
ax = gca;
You can look at the code for pdeinit
: type edit pdeinit
in your command window. You'll see that all it does is open pdetool
(unless it's already open) and return handles to the resultant figure and axis.
Additionally, pderect
will open pdetool
on its own. You're using a bunch of functions that are all tied to the PDE app. Many of the tutorials and examples on The MathWorks's site use this. You might check out this article on how to solve PDEs programmatically. The examples might also be helpful.