Using MATLAB (779505), страница 39
Текст из файла (страница 39)
For more information about document sections, see the MicrosoftWord documentation.Define Input Cell CommandThe Define Input Cell command creates an input cell by converting thecurrent paragraph, selected text, or autoinit cell. An input cell contains aMATLAB command.ActionIf you select this command while the cursor is in a paragraph of text, Notebookconverts the entire paragraph to an input cell. If you select this command whiletext is selected, Notebook converts the text to an input cell.10-2710Using NotebookIf you select this command while the cursor is in an autoinit cell, Notebookconverts the autoinit cell to an input cell.FormatNotebook encloses the text in cell markers and formats the cell using the Inputstyle, defined as bold, dark green, 10-point Courier New.See AlsoFor more information about creating input cells, see “Defining MATLABCommands as Input Cells” on page 10-8.
For information about evaluatinginput cells, see “Evaluating MATLAB Commands” on page 10-12.Evaluate Calc Zone CommandThe Evaluate Calc Zone command sends the input cells in the current calczone to MATLAB to be evaluated. A calc zone is a contiguous block of relatedtext, input cells, and output cells that describes a specific operation or problem.The current calc zone is the Word section that contains the cursor.ActionAs Notebook evaluates each input cell, it generates an output cell.
When youevaluate an input cell for which there is no output cell, Notebook places theoutput cell immediately after the input cell that generated it. If you evaluatean input cell for which there is an output cell, Notebook replaces the results inthe output cell wherever it is in the M-book.See AlsoFor more information, see “Evaluating a Calc Zone” on page 10-14.Evaluate Cell CommandThe Evaluate Cell command sends the current input cell or cell group toMATLAB to be evaluated.
An input cell contains a MATLAB command. A cellgroup is a single, multiline input cell that contains more than one MATLABcommand. Notebook displays the output or an error message in an output cell.10-28Notebook Command ReferenceActionIf you evaluate an input cell for which there is no output cell, Notebook placesthe output cell immediately after the input cell that generated it. If youevaluate an input cell for which there is an output cell, Notebook replaces theresults in the output cell wherever it is in the M-book. If you evaluate a cellgroup, all output for the cell appears in a single output cell.An input cell or cell group is the current input cell or cell group if:• The cursor is in the input cell or cell group.• The cursor is at the end of the line that contains the closing cell marker forthe input cell or cell group.• The cursor is in the output cell for the input cell or cell group.• The input cell or cell group is selected.Note Evaluating a cell that involves a lengthy operation may cause atime-out.
If this happens, Word displays a time-out message and asks whetheryou want to continue waiting for a response or terminate the request. If youchoose to continue, Word resets the time-out value and continues waiting for aresponse. Word sets the time-out value; you cannot change it.See AlsoFor more information, see “Evaluating MATLAB Commands” on page 10-12.For information about evaluating the entire M-book, see “Evaluating an EntireM-Book” on page 10-15.Evaluate Loop CommandThe Evaluate Loop command evaluates the selected input cells repeatedly.For more information, see “Using a Loop to Evaluate Input Cells Repeatedly”on page 10-15.10-2910Using NotebookEvaluate M-Book CommandThe Evaluate M-book command evaluates the entire M-book, sending allinput cells to MATLAB to be evaluated.
Notebook begins at the top of theM-book regardless of the cursor position.ActionAs Notebook evaluates each input cell, it generates an output cell. When youevaluate an input cell for which there is no output cell, Notebook places theoutput cell immediately after the input cell that generated it. If you evaluatean input cell for which there is an output cell, Notebook replaces the results inthe output cell wherever it is in the M-book.See AlsoFor more information, see “Evaluating an Entire M-Book” on page 10-15.Group Cells CommandThe Group Cells command converts the input cells in the selection into asingle multiline input cell called a cell group. You evaluate a cell group usingthe Evaluate Cell command.
When you evaluate a cell group, all of its outputfollows the group and appears in a single output cell.ActionIf you include text in the selection, Notebook moves it after the cell group.However, if text precedes the first input cell in the group, the text will remainbefore the group.If you include output cells in the selection, Notebook deletes them. If you selectall or part of an output cell before selecting this command, Notebook includesits input cell in the cell group.If the first line in the cell group is an autoinit cell, the entire group acts as asequence of autoinit cells. Otherwise, the group acts as a sequence of inputcells.You can convert an entire cell group to an autoinit cell with the DefineAutoInit Cell command.10-30Notebook Command ReferenceSee AlsoFor more information, see “Defining Cell Groups” on page 10-8.
Forinformation about converting a cell group to individual input cells, see thedescription of the “Ungroup Cells Command” on page 10-32.Hide Cell Markers CommandThe Hide Cell Markers command hides cell markers in the M-book.When you select this command, it changes to Show Cell Markers.Note Notebook does not print cell markers whether you choose to hide themor show on the screen.Notebook Options CommandThe Notebook Options command allows you to examine and modify displayoptions for numeric and graphic output.See AlsoSee “Printing and Formatting an M-Book” on page 10-18 for more information.Purge Output Cells CommandThe Purge Output Cells command deletes all output cells from the currentselection.See AlsoFor more information, see “Deleting Output Cells” on page 10-17.Toggle Graph Output for Cell CommandThe Toggle Graph Output for Cell command suppresses or allows graphicoutput from an input cell.If an input or autoinit cell generates figure output that you want to suppress,place the cursor in the input cell and choose this command.
The string (no10-3110Using Notebookgraph) will be placed after the input cell to indicate that graph output for thatcell will be suppressed.To allow graphic output for that cell, place the cursor inside the input cell andchoose Toggle Graph Output for Cell again. The (no graph) marker will beremoved. This command overrides the Embed Graphic Output in the M-Bookoption, if that option is set in the Notebook Options dialog.See AlsoSee “Embedding Graphic Output in the M-Book” on page 10-21 and“Suppressing Graphic Output for Individual Input Cells” on page 10-21 formore information.Undefine Cells CommandThe Undefine Cells command converts the selected cells to text.
If no cells areselected but the cursor is in a cell, Notebook undefines that cell. Notebookremoves the cell markers and reformats the cell according to the Normal style.If you undefine an input cell, Notebook automatically undefines its output cell.However, if you undefine an output cell, Notebook does not undefine its inputcell. If you undefine an output cell containing an embedded graphic, thegraphic remains in the M-book but is no longer associated with an input cell.See AlsoFor information about the Normal style, see “Modifying Styles in the M-BookTemplate” on page 10-18. For information about deleting output cells, see thedescription of the “Purge Output Cells Command” on page 10-31.Ungroup Cells CommandThe Ungroup Cells command converts the current cell group into a sequenceof individual input cells or autoinit cells.
If the cell group is an input cell,Notebook converts the cell group to input cells. If the cell group is an autoinitcell, Notebook converts the cell group to autoinit cells. Notebook deletes theoutput cell for the cell group.A cell group is the current cell group if:• The cursor is in the cell group.10-32Notebook Command Reference• The cursor is at the end of a line that contains the closing cell marker for thecell group.• The cursor is in the output cell for the cell group.• The cell group is selected.See AlsoFor information about creating cell groups, see the description of the “DefiningCell Groups” on page 10-8.10-3310Using Notebook10-34MathematicsMATLAB provides many functions for performing mathematical operationsand analyzing data.
The following list summarizes the contents of thiscollection:• Matrices and Linear Algebra — describes matrix creation and matrixoperations that are directly supported by MATLAB. Topics covered includematrix arithmetic, linear equations, eigenvalues, singular values, andmatrix factorizations.• Polynomials and Interpolation — describes functions for standardpolynomial operations such as polynomial roots, evaluation, anddifferentiation. Additional topics covered include curve fitting and partialfraction expansion.• Data Analysis and Statistics — describes how to organize arrays for dataanalysis, how to use simple descriptive statistics functions, and how toperform data pre-processing tasks in MATLAB. Additional topics coveredinclude regression, curve fitting, data filtering, and fast Fourier transforms(FFTs).• Function Functions — describes MATLAB functions that work withmathematical functions instead of numeric arrays.
These function functionsinclude plotting, optimization, zero finding, and numerical integration(quadrature).• Differential Equations — describes the solution, in MATLAB, of initial valueproblems for ordinary differential equations (ODEs) anddifferential-algebraic equations (DAEs), and the solution of boundary valueproblems for ODEs.















