Using MATLAB (779505), страница 12
Текст из файла (страница 12)
For example, if you enter 10, when you use the tabcompletion feature, MATLAB displays the list of possible completions ifthere are 10 or less. If there are more than 10, MATLAB displays a messagestating there are more than 10 completions.Uncheck the box if you do not want to use the tab completion feature.MATLAB moves the cursor to the next tab stop when you press the Tab key,rather than completing a function.• Command session scroll buffer size – Set the size of the buffer thatmaintains a list of previously run commands to be used for command recall.See “Recalling Previous Lines” on page 3-7 for more information.Font & Colors Preferences for the Command WindowFont.
Command Window font preferences specify the characteristics of the fontused in the Command Window. Select Use desktop font if you want the font inthe Command Window to be the same as that specified for General Font &Colors preferences.3-153Running MATLAB FunctionsIf you want the Command Window font to be different, select Use custom fontand specify the font characteristics for the Command Window:• Type, for example, SansSerif• Style, for example, bold• Size in points, for example, 12 pointsAfter you make a selection, the Sample area shows how the font will look.Colors. Specify the colors used in the Command Window:• Text color – The color of nonspecial text; special text uses colors specified forSyntax highlighting• Background color – The color of background in the window• Syntax highlighting – The colors to use to highlight syntax. If checked, clickSet Colors to specify them.
For a description of syntax highlighting, see“Syntax Highlighting” on page 3-5.3-16Command HistoryCommand HistoryThe Command History window appears when you first start MATLAB. TheCommand History window displays a log of the functions most recently run inthe Command Window. To show or hide the Command History window, use theView menu – see “Opening and Closing Desktop Tools” on page 2-7 for details.Use the Command History window for:• “Viewing Functions in the Command History Window” on page 3-17• “Running Functions from the Command History Window” on page 3-18• “Copying Functions from the Command History Window” on page 3-19Timestamp marks thestart of each session.Select one or more linesand right-click to copy,evaluate, or create anM-file from theViewing Functions in the Command HistoryWindowThe log in the Command History window includes functions from the currentsession, as well as from previous sessions.
The time and date for each sessionappear at the top of the history of functions for that session. Use the scroll baror the up and down arrow keys to move through the Command History window.3-173Running MATLAB FunctionsThe Command History file is history.m. Type prefdir in the CommandWindow to see the location of the file. The history.m file is loaded whenMATLAB starts and overwritten when you close MATLAB.Deleting Entries in the Command History WindowDelete entries in the Command History window when you feel there are toomany and it’s inconvenient finding the ones you want. All entries remain untilyou delete them.To delete entries in the Command History window, select an entry, orShift+click or Ctrl+click to select multiple entries, or use Ctrl+A to select allentries.
Then right-click and select one of the delete options from the contextmenu:• Delete Selection – Deletes the selection• Delete to Selection – Deletes all functions previous to (above) the selectedfunction• Delete Entire History – Deletes all functions in the Command HistorywindowAnother way to clear the entire history is by selecting Clear CommandHistory from the Edit menu.Running Functions from the Command HistoryWindowDouble-click on any function entry (entries) in the Command History windowto execute that function(s).
For example, double-click edit myfile to openmyfile.m in the Editor. You can also run a function entry by right-clicking onit and selecting Evaluate Selection from the context menu, or by copying thefunction entry to the Command Window, as described in the next section.3-18Command HistoryCopying Functions from the Command HistoryWindowSelect a function entry, or Shift+click or Ctrl+click to select multiple entries,or use Ctrl+A to select all entries. Then you can do any of the following.ActionHow to Perform the ActionRun the functions in thecommand windowCopy the selection to the clipboard byright-clicking and selecting Copy fromthe context menu.
Paste the selection intothe Command Window. (Alternatively,drag the selection to the CommandWindow.) In the Command Window, editthe functions if desired, and press Enteror Return to execute the functions.Copy the functions to anotherwindowCopy the selection to the clipboard byright-clicking and selecting Copy fromthe context menu. Paste the selection intoan open M-file in the Editor or anyapplication.Create an M-file from thefunctionsRight-click the selection and selectCreate M-File from the context menu.The Editor opens a new M-file thatcontains the functions you selected fromthe Command History window.3-193Running MATLAB Functions3-204Getting HelpTypes of Information .
. . . . . . . . . . . . . . . 4-3Using the Help Browser . . . . . . . . . . . . . . . 4-4Using the Help Navigator . . . . . . . . . . . . . . 4-7Viewing Documentation in the Display Pane . . . . . 4-17Preferences for the Help Browser . . . . . . . . . . 4-21Printing Documentation. . . . . . . . . . . . . . 4-26Using Help Functions . .
. . . . . . . . . . . . . . 4-28Other Methods for Getting Help . . . . . . . . . . . 4-314Getting HelpThe MathWorks provides online help for all products. Printed versions for someof the online documentation are also provided. The online material sometimeshas information not included with the printed material and may be morecurrent than the printed material.The primary ways to access the online help are:• “Using the Help Browser” on page 4-4 – Use the Help browser to find andview information about your MathWorks products.
It includes a contentslisting, global index, and search feature.• “Using Help Functions” on page 4-28 – Type help functionname to get M-filehelp, which provides a brief description of the function and its syntax in theCommand Window. Other help functions are available as well.• “Other Methods for Getting Help” on page 4-31 – You can useproduct-specific help features, run demos, contact Technical Support, searchdocumentation for other MathWorks products, view a list of other books, andparticipate in a MATLAB newsgroup.In addition to using online help, you can print documentation – see “PrintingDocumentation” on page 4-26.4-2Types of InformationTypes of InformationThe Help browser and help functions provide access to the following types ofdocumentation. Use the type of documentation most suited to your needs.• Release Notes – An overview of new products and features in this release, italso includes upgrade information and any known problems and limitations.Review the Release Notes for all your products when you first start using thenew release.• Getting Started with ...
– Primarily aimed at novice users, thisdocumentation contains instructions for a product’s main features. ReviewGetting Started documentation before you begin using a product or featurefor the first time. Then, to learn more, go to the “Using...” collections orreference pages.• Using ... collections – This material contains overviews and completeinstructions for using a product. Consult it after reviewing Getting Startedmaterial.• Reference Pages – Every function has a reference page that provides thesyntax, description, examples, and other information for that function. Itincludes links to related functions and additional information. Referencepages are also provided for blocks.
Use reference pages to learn about afunction or to see its syntax.• M-File Help – Get M-file help in the Command Window to quickly accessbasic information for a function. It provides a brief description of a functionand its syntax. It is called M-file help because the text of the help is a seriesof comments at the start of the M-file for a function.• Product Page – Available on MathWorks Web site, a product page containsthe latest product information, such as system requirements.• Online Knowledge Base – This is the MathWorks Technical Support onlineknowledge base.















