Using MATLAB (779505), страница 8
Текст из файла (страница 8)
2-7. 2-9. 2-10. 2-16Common Desktop Features . . .Desktop Toolbar . . . . . . . . .Context Menus . . . . . . . . .Keyboard Shortcuts and AcceleratorsSelecting Multiple Items . . . . . .Using the Clipboard . . . . . . .Accessing The MathWorks on the Web.................................................. 2-17. 2-17. 2-17. 2-18. 2-19. 2-20. 2-20..............Setting Preferences . . . . . . . .
. . . . . . . . . 2-21General Preferences for MATLAB . . . . . . . . . . . . 2-232Using the DesktopWhen you start MATLAB, the MATLAB desktop appears, containing tools(graphical user interfaces) for managing files, variables, and applicationsassociated with MATLAB. Think of the desktop as your instrument panel forMATLAB. The main things you need to know about the desktop are:• “Desktop Tools” on page 2-4 – All of the tools managed by the desktop.• “Configuring the Desktop” on page 2-7 – Arranging the tools in the desktop.• “Common Desktop Features” on page 2-17 – Features you can use in thetools, such as context menus.The first time MATLAB starts, the desktop appears as shown in the followingillustration, although your Launch Pad may contain different entries.2-2Expand to viewdocumentation, demos,and tools for your productsView or use previously run functionsGet helpEnterMATLABfunctionsUse tabs to go to Workspace browseror Current Directory browserView or changecurrentdirectoryClick to move windowoutside of desktopClose windowDrag the separator bar to resize windows2-32Using the DesktopDesktop ToolsThe following tools are managed by the MATLAB desktop, although not all ofthem appear by default when you first start.
If you prefer a command lineinterface, you can use functions to perform most of the features found in theMATLAB desktop tools. Instructions for using these function equivalents areprovided with the documentation for each tool.• Command Window – Run MATLAB functions.• Command History – View a log of the functions you entered in the CommandWindow, copy them, and execute them.• Launch Pad – Run tools and access documentation for all of your MathWorksproducts.• Current Directory Browser – View MATLAB files and related files, andperform file operations such as open, and find content.• Help Browser – View and search the documentation for the full family ofMATLAB products.• Workspace Browser – View and make changes to the contents of theworkspace.• Array Editor – View array contents in a table format and edit the values.• Editor/Debugger – Create, edit, and debug M-files (files containing MATLABfunctions).Other MATLAB tools and windows, such as figure windows, are not managedby the desktop.2-4Desktop ToolsLaunch PadMATLAB’s Launch Pad provides easy access to tools, demos, anddocumentation for all of your MathWorks products.
To open it, select LaunchPad from the View menu in the MATLAB desktop. All the products installedon your system are listed.Sample of listings in Launch Pad – you’ll see listings for all products installed on your system.Help – double-click to go directly todocumentation for the product.Demos – double-click to display thedemo launcher for the product.Tools – double-click to open the tool.Product Page – double-click to view thelatest product information on theMathWorks Web site.Click + to show the listing for a product.To display the listings for a product, click the + to the left of the product. Tocollapse the listings, click the - to the left of the product.To open one of the listings, double-click it, or right-click and select Open fromthe context menu.
The action depends on the listing you selected, as describedin the following table.IconDescription of Action When OpenedDocumentation roadmap page for that product opens in theHelp browser.Demo launcher opens, with the demo for that product selected.Selected tool opens.Product Page, which contains the latest product informationon the MathWorks Web site, opens in your Web browser.2-52Using the DesktopRefreshing the Launch PadThe Launch Pad includes entries for all products found on the MATLAB searchpath when the MATLAB session was started.
If you change the search pathafter the start of a session, such as by adding a toolbox directory, the LaunchPad is not automatically updated. Right-click in the Launch Pad and selectRefresh from the context menu to update the Launch Pad so it reflects allproducts on the current search path.Adding Your Own Entries to the Launch PadYou can add your own entries to the Launch Pad by creating an info.xml file.To see an example, select one of the existing entries in the Launch Pad,right-click, and select Edit Source from the context menu.
The info.xml filefor that product appears. The line for the tool you selected appears highlighted.Create a similar info.xml file for your own application and put it in a folderthat is on the search path. Right-click in the Launch Pad and select Refreshfrom the context menu to update the Launch Pad so it includes your entries.2-6Configuring the DesktopConfiguring the DesktopYou can modify the desktop configuration to best meet your needs. Close toolsyou don’t use, open those you do, resize, and reposition them. Configure theMATLAB desktop by:• “Opening and Closing Desktop Tools” on page 2-7• “Resizing Windows” on page 2-9• “Moving Windows” on page 2-10• “Using Predefined Desktop Configurations” on page 2-16When you end a session, MATLAB saves its desktop configuration. The nexttime you start MATLAB, the desktop is restored the way you left it.Opening and Closing Desktop ToolsAs part of configuring the MATLAB desktop so that it best meets your needs,you can use the following features:• “Opening Desktop Tools” on page 2-7 – Open only those tools you use.• “Going to Documents in Desktop Tools” on page 2-8 – Go directly to openedM-files, figures, and more.• “Closing Desktop Tools” on page 2-9 – Close those tools you don’t use.Opening Desktop ToolsTo open a tool from the desktop, select the tool from the View menu ordouble-click it in the list of tools displayed in the Launch Pad for MATLAB.
Thetool opens in the location it occupied the last time it was open.There are a few tools controlled by the desktop that you don’t open from theView menu or Launch Pad:• Array Editor – Open it by double-clicking a variable in the WorkspaceBrowser.• Editor/Debugger – Open it by creating a new M-file or opening an existingM-file. For instructions, see “Starting the Editor/Debugger” on page 7-3.Another way to open a tool is using a function. For example, helpbrowser opensthe Help browser. These functions are documented with each tool.2-72Using the DesktopThe following example shows how the MATLAB desktop might look with theCommand Window, Command History, and Help browser open.Going to Documents in Desktop ToolsThe Window menu displays all open Editor/Debugger documents, variables inthe Array Editor, and figure windows.
Select an entry in the Window menu togo directly to that window or tabbed document. Select Close All to close allitems listed in the Window menu.For example, the Window menu in the following illustration shows threedocuments open in the Array Editor and two documents open in the Editor/2-8Configuring the DesktopDebugger. Selecting variance.m, for example, makes the Editor/Debuggerwindow with the file variance.m become the active window.Close All closes all itemslisted in the Window menu.Three variables are open in theArray Editor: x, y, and m.Two files are open in theEditor/Debugger: sqsum.mand variance.m.Click on an item to go directly to that window.Closing Desktop ToolsTo close a desktop tool, do one of the following:• Select the item in the View menu (the item becomes unchecked).• Click the close boxin the window’s title bar.• Select Close from the File menu to close the current window.The window closes.Resizing WindowsTo resize windows in the MATLAB desktop, use the separator bar, which is thebar between two windows:1 Move the cursor onto the separator bar.The cursor assumes a different shape.
On Windows platforms, it is adouble-headed arrow. On UNIX, it is an arrow with a bar.2-92Using the Desktop2 Drag the separator bar to change the sizes of the windows.Drag separator bar to resize windows in the desktopTo resize the MATLAB desktop itself or windows for MATLAB tools outside ofthe desktop, drag any edge or corner of the window.Moving WindowsThere are three basic ways to move MATLAB desktop windows:• “Moving Windows Within the MATLAB Desktop” on page 2-10• “Moving Windows Out of the MATLAB Desktop” on page 2-12 and “MovingWindows Into the MATLAB Desktop” on page 2-13• “Grouping (Tabbing) Windows Together” on page 2-13Moving Windows Within the MATLAB DesktopTo move a window to another location in the MATLAB desktop:1 Drag the title bar of the window towards where you want the window to belocated.As you drag the window, an outline of it appears.















