![]() ![]() Colormaps can be any length (up to 256 only on MS-Windows), but must be three columns wide. For example, an index of 1 specifies the first RGB triplet, an index of 2 specifies the second RGB triplet, and so on. MATLAB accesses colors by their row number. This property is an m-by-3 array of red, green, and blue (RGB) intensity values that define m individual colors. Colormap m-by-3 matrix of RGB valuesįigure colormap. You can specify a color using a three-element vector of RGB values or one of the MATLAB predefined names. This property controls the figure window background color. See Function Handle Callbacks for information on how to use function handles to define the callback function. MATLAB then uses this setting for the CloseRequestFcn of all subsequently created figures. set(0,'DefaultFigureCloseRequestFcn','my_closereq').To make this M-file your default close request function, set a default value on the root level. set(figure_handle,'CloseRequestFcn','my_closereq').Now assign this M-file to the CloseRequestFcn of a figure: Selection = questdlg('Close Specified Figure?'. The following M-file illustrates how to do this. (Note that you can always call delete( figure_handle ) from the command line if you have created a window with a nondestructive close request function.)Ī more useful application of the close request function is to display a question dialog box asking the user to confirm the close operation. Unless the close request function calls delete, MATLAB never closes the figure. This close request function never closes the figure window it simply echoes "This window is immortal" on the command line. ![]() set(gcf,'CloseRequestFcn','disp(''This window is immortal'')').You can set CloseRequestFcn to any string that is a valid MATLAB statement, including the name of an M-file. closereq takes advantage of the fact that the close command makes all figures specified as arguments the current figure before calling the respective close request function. These statements unconditionally delete the current figure, destroying the window. The default function is named closereq and is predefined as: The close operation executes the function defined by the figure CloseRequestFcn.A user issues the close command from the command line, by closing the window from the computer's window manager menu, or by quiting MATLAB.It allows you to, for example, display a dialog box to ask a user to confirm or cancel the close operation or to prevent users from closing a figure that contains a GUI. The CloseRequestFcn provides a mechanism to intervene in the closing of a figure. This property defines a function that MATLAB executes whenever you issue the close command (either a close(figure_handle) or a close all), when you close a figure window from the computer's window manager menu, or when you quit MATLAB. CloseRequestFcn string or function handleįunction executed on figure close. This section lists property names along with the type of values each accepts. To change the default value of properties see Setting Default Property Values. The set and get commands enable you to set and query the values of properties.The Property Editor is an interactive tool that enables you to see and change object property values.You can set and query graphics object properties in two ways: Figure Properties (MATLAB Functions) MATLAB Function Reference
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |