FUNCTION REFERENCE

registerApp

Register a UIFigure with an AppBase app instance.

Register a UIFigure with an AppBase app instance.

Syntax

registerApp(app, fig)

Links a matlab.apps.AppBase subclass instance app with its uifigure handle fig so deleting or closing fig (without a vetoing CloseRequestFcn) deletes app, deleting app deletes fig, and clearing app inside a zero-output constructor keeps the app alive while fig remains open.

Example

d = tempname; mkdir(d); addpath(d); writelines(["classdef RegHelpApp < matlab.apps.AppBase","properties","UIFigure matlab.ui.Figure","end","methods","function app = RegHelpApp","app.UIFigure = uifigure('Visible','off');","registerApp(app, app.UIFigure);","end","end","end"], fullfile(d, "RegHelpApp.m")); a = RegHelpApp; f = a.UIFigure; close(f); ~isvalid(a); rmpath(d); rmdir(d, 's')

Differences from MATLAB: Only registers uifigure handles; classic figure handles and App Designer RunningAppInstance lifecycle hooks are not supported.

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