FUNCTION REFERENCE

runStartupFcn

Execute an AppBase app's startup function.

Execute an AppBase app's startup function.

Syntax

runStartupFcn(app, @startupFcn)

Syntax

runStartupFcn(app, @(app)startupFcn(app, varargin{:}))

Calls the startup function handle with app, granting access to private methods of app's class. If the startup function errors, app is deleted before the error propagates.

Example

d = tempname; mkdir(d); addpath(d); writelines(["classdef StartHelpApp < matlab.apps.AppBase","properties","UIFigure matlab.ui.Figure","Ready logical = false","end","methods (Access = private)","function startupFcn(app, flag)","app.Ready = flag;","end","end","methods","function app = StartHelpApp(varargin)","app.UIFigure = uifigure('Visible','off');","registerApp(app, app.UIFigure);","runStartupFcn(app, @(app)startupFcn(app, varargin{:}));","end","end","end"], fullfile(d, "StartHelpApp.m")); a = StartHelpApp(true); a.Ready; delete(a); rmpath(d); rmdir(d, 's')

Differences from MATLAB: App Designer visual editor and RunningAppInstance tracking are not supported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.