You can export .fig file to the .m file (File -> Export to MATLAB file) and edit in the OpeningFcn.
For example, paste the following code in the OpeningFcn
load franke
sf = fit([x,y],z,'poly23');
plot(sf,[x,y],z);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!