Using MATLAB (779505), страница 7
Текст из файла (страница 7)
Specifically use:• edit to open the Editor/Debugger• helpbrowser to open the Help browser• filebrowser to open the Current Directorybrowser• workspace to open the Workspace browser• openvar to open the Array EditorYou cannot use the LaunchPad and theCommand History window in -nodesktopmode.Don’t use nodesktop to provide a commandline interface, if you prefer that over thedesktop tools. Instead, select View -> DesktopLayout -> Command Window Only.1-8Starting MATLABOptionDescription (Continued)-nojvmStart MATLAB without loading the Java VM.This minimizes memory usage and improvesinitial startup speed. With nojvm, you cannotuse the desktop, nor any of the tools thatrequire Java.
The restrictions are the same asthose described under UNIX PlatformLimitations in the R12 Release Notes.-nosplashStart MATLAB without displaying the splashscreen during startup.For example, to start MATLAB without the splash screen, typematlab -nosplash1-91Starting and Quitting MATLABReducing Startup Time with Toolbox Path CachingIf you run MATLAB from a network server, you can significantly reduce yourstartup time by using the MATLAB toolbox path cache. The toolbox path cachestores search path information on all toolbox directories under the MATLABroot directory.
During startup, MATLAB obtains this information from thecache rather than by reading it from the remote file system.The toolbox path cache is used only during the startup of your MATLABsession. It is especially useful if you define your MATLAB search path toinclude many toolbox directories. It takes considerable time to acquire all ofthis information by scanning directories in the remote file system.
Reading itfrom a pre-generated cache however, is significantly faster. If you have a shorttoolbox path, there is less benefit to using the cache, but it does still provide atime savings.If you run MATLAB on a local disk, where your files are not served from aremote system, then the cache may provide no noticeable reduction in startuptime. In this case, you may want to leave the toolbox path cache disabled.Selecting Toolbox Path Cache PreferencesTo generate and enable or disable the toolbox path cache, use MATLABpreferences.1 From the MATLAB desktop, select Preferences from the File menu.The Preferences dialog box appears.1-10Starting MATLAB2 In the left pane of the dialog box, click General to display the GeneralPreferences panel in the right pane.3 To use the cache or to regenerate the cache, select Enable toolbox cacheunder Toolbox caching.With Enable toolbox cache selected, MATLAB displays summaryinformation during startup, sends notification when it loads the toolboxdirectories from the cache, and displays a warning if the toolbox path cachecannot be found.1-111Starting and Quitting MATLAB4 For additional information, select Enable toolbox cache diagnostics.With Enable toolbox cache diagnostics selected, MATLAB displaysadditional information at startup.MATLAB also provides warnings whenever a toolbox directory is added tothe path from the remote file system at startup rather than from the cache.This occurs if the cache has not been kept up to date with changes in thetoolbox directories.5 To generate a new copy of the cache, select Update Toolbox Cache.
See“Generating the Toolbox Path Cache” on page 1-12 for more information.To use this, you need write access to the directory that holds the cache file.The button will be grayed out if you don’t have write access.6 Select OK.Generating the Toolbox Path CacheThe toolbox path cache is in a MAT-file in the toolbox/local directory on thesystem that serves files for MATLAB. When you first install MATLAB on thissystem, you or your system administrator needs to generate the cache.(MATLAB does not ship with a prebuilt cache). You also need to regenerate thecache file whenever toolbox directories are added or removed so that the cachedoes not hold out-dated path information. To do so, select Update ToolboxCache as described in “Selecting Toolbox Path Cache Preferences” onpage 1-10.Function Equivalent.
To update the cache, type the following in the CommandWindow.rehash toolboxcacheEnabling Use of the CacheWhen MATLAB is first installed, the toolbox path cache feature is disabled. Inorder to make use of the cache on a distributed file system:1 The system administrator enables caching and generates the initial toolboxpath cache on the system that serves files for MATLAB. This is explained in“Generating the Toolbox Path Cache” on page 1-12.1-12Starting MATLAB2 Each user that intends to use toolbox directory caching enables the cache ontheir own system.On a nondistributed system, the system user performs both steps.To enable toolbox path caching, follow the instructions under “SelectingToolbox Path Cache Preferences” on page 1-10.You can disable the use of this feature either on a user-by-user basis or on aglobal basis.
To disable it on a per-user basis, uncheck Enable toolbox cachein the Preferences dialog box. To disable it on a global basis, remove the filetoolbox_cache.mat from the toolbox/local directory.Updating the CacheIf you make changes to your toolbox directories, your toolbox path cache file canbecome out of date. Depending upon the reason for this, you may or may notreceive a warning that your cache needs to be updated. This section explainswhen you need to update your toolbox path cache and how to avoid problemscaused by an out-dated cache file.Updating Cache Following a Product Install or Update. If you install a new toolbox oran update from The MathWorks, it is likely that the information stored in thetoolbox path cache no longer accurately reflects your toolbox directories.
Aspart of the installation process, the MATLAB installer marks the cache asbeing invalid.When your cache is marked invalid, MATLAB ceases to use cache duringstartup, loading path information by accessing the directories through the filesystem instead. MATLAB issues a message at startup to warn you that yourtoolbox path cache is out-dated and is being ignored.
To resume use of thecache, you need to regenerate it using the procedure described in “Generatingthe Toolbox Path Cache” on page 1-12.Updating Cache Following Changes to Toolbox Directories. If you make changes to theMATLAB toolbox directories (for example, by adding or deleting files), the pathinformation in the toolbox path cache file becomes out of date. When you startup your next MATLAB session, this out-dated path information will be loadedinto memory from the cache. MATLAB does not issue a warning when thisoccurs.1-131Starting and Quitting MATLABIf you choose to make changes that affect the toolbox path, you must regeneratethe cache file using the procedure described in “Generating the Toolbox PathCache” on page 1-12.Caution The MathWorks strongly recommends that you do not dodevelopment work in the toolbox area when toolbox path caching is enabled. Ifdo you use the toolbox area for this purpose and neglect to regenerate thecache afterwards, MATLAB will use an inaccurate record of your toolboxdirectories in subsequent MATLAB sessions.
As a result, MATLAB will beunable to locate new files that you have added.1-14Quitting MATLABQuitting MATLABTo quit MATLAB at any time, do one of the following:• Select the close boxin the MATLAB desktop.• Select Exit MATLAB from the desktop File menu.• Type quit at the Command Window prompt.MATLAB closes immediately, without issuing a warning.
If you want to see awarning, use the finishdlg.m script as described in the next paragraph.Running a Script When Quitting MATLABWhen MATLAB quits, it runs the script finish.m, if finish.m exists in thecurrent directory or anywhere on the MATLAB search path.
You create the filefinish.m. It contains functions to run when MATLAB terminates, such assaving the workspace or displaying a confirmation dialog box. There are twosample files in $matlabroot\toolbox\local that you can use as the basis foryour own finish.m file:• finishsav.m – Includes a save function so the workspace is saved to aMAT-file when MATLAB quits.• finishdlg.m – Displays a confirmation dialog box that allows you to cancelquitting.1-151Starting and Quitting MATLAB1-162Using the DesktopDesktop Tools . .
. . . . . . . . . . . . . . . . . 2-4Launch Pad . . . . . . . . . . . . . . . . . . . . . 2-5Configuring the Desktop . . . . . .Opening and Closing Desktop Tools . . .Resizing Windows . . . . . . . . . .Moving Windows . . . . . . . . . . .Using Predefined Desktop Configurations.................................... 2-7.















