Matlab - Getting start, страница 3
Описание файла
PDF-файл из архива "Matlab - Getting start", который расположен в категории "". Всё это находится в предмете "цифровая обработка сигналов (цос)" из 8 семестр, которые можно найти в файловом архиве МГТУ им. Н.Э.Баумана. Не смотря на прямую связь этого архива с МГТУ им. Н.Э.Баумана, его также можно найти и в других разделах. Архив можно найти в разделе "книги и методические указания", в предмете "цифровая обработка сигналов" в общих файлах.
Просмотр PDF-файла онлайн
Текст 3 страницы из PDF
To execute specified functionseach time MATLAB quits, such as saving the workspace, you can create andrun a finish.m script.2-32Development EnvironmentMATLAB DesktopWhen you start MATLAB, the MATLAB desktop appears, containing tools(graphical user interfaces) for managing files, variables, and applicationsassociated with MATLAB.The first time MATLAB starts, the desktop appears as shown in the followingillustration, although your Launch Pad may contain different entries.Expand to viewdocumentation, demos, andtools for your products.Get help.View or use previously run functions.2-4EnterMATLABfunctions.Use tabs to go to Workspace browseror Current Directory browser.View or changecurrentdirectory.Click to move windowoutside of desktop.Drag the separator bar to resize windows.Close window.MATLAB DesktopYou can change the way your desktop looks by opening, closing, moving, andresizing the tools in it.
You can also move tools outside of the desktop or returnthem back inside the desktop (docking). All the desktop tools provide commonfeatures such as context menus and keyboard shortcuts.You can specify certain characteristics for the desktop tools by selectingPreferences from the File menu. For example, you can specify the fontcharacteristics for Command Window text. For more information, click theHelp button in the Preferences dialog box.2-52Development EnvironmentDesktop ToolsThis section provides an introduction to MATLAB’s desktop tools. You can alsouse MATLAB functions to perform most of the features found in the desktoptools.
The tools are:• “Command Window”• “Command History”• “Launch Pad”• “Help Browser”• “Current Directory Browser”• “Workspace Browser”• “Array Editor”• “Editor/Debugger”Command WindowUse the Command Window to enter variables and run functions and M-files.For more information on controlling input and output, see “ControllingCommand Window Input and Output” on page 3-28.Type functions andvariables at theMATLAB prompt.MATLAB displays theresults.2-6Desktop ToolsCommand HistoryLines you enter in the Command Window are logged in the Command Historywindow. In the Command History, you can view previously used functions, andcopy and execute selected lines.Timestamp marks thestart of each session.Select one or more linesand right-click to copy,evaluate, or create anM-file from the selection.To save the input and output from a MATLAB session to a file, use the diaryfunction.Running External ProgramsYou can run external programs from the MATLAB Command Window.
Theexclamation point character ! is a shell escape and indicates that the rest of theinput line is a command to the operating system. This is useful for invokingutilities or running other programs without quitting MATLAB. On Linux, forexample,!emacs magik.minvokes an editor called emacs for a file named magik.m. When you quit theexternal program, the operating system returns control to MATLAB.2-72Development EnvironmentLaunch PadMATLAB’s Launch Pad provides easy access to tools, demos, anddocumentation.Sample of listings in Launch Pad – you’ll see listingsfor all products installed on your system.Help - double-click to go directly todocumentation for the product.Demos - double-click to display the demolauncher for the product.Tools - double-click to open the tool.Click + to show the listing for a product.Help BrowserUse the Help browser to search and view documentation for all yourMathWorks products.
The Help browser is a Web browser integrated into theMATLAB desktop that displays HTML documents.2-8Desktop ToolsTo open the Help browser, click the help buttonhelpbrowser in the Command Window.Tabs in the Help Navigator pane provide different ways to find documentation.Use the close box to hide the pane.in the toolbar, or typeView documentation in the display pane.Drag the separator bar to adjust the width of the panes.The Help browser consists of two panes, the Help Navigator, which you use tofind information, and the display pane, where you view the information.2-92Development EnvironmentHelp NavigatorUse to Help Navigator to find information. It includes:• Product filter – Set the filter to show documentation only for the productsyou specify.• Contents tab – View the titles and tables of contents of documentation foryour products.• Index tab – Find specific index entries (selected keywords) in theMathWorks documentation for your products.• Search tab – Look for a specific phrase in the documentation.
To get help fora specific function, set the Search type to Function Name.• Favorites tab – View a list of documents you previously designated asfavorites.Display PaneAfter finding documentation using the Help Navigator, view it in the displaypane. While viewing the documentation, you can:• Browse to other pages – Use the arrows at the tops and bottoms of the pages,or use the back and forward buttons in the toolbar.• Bookmark pages – Click the Add to Favorites button in the toolbar.• Print pages – Click the print button in the toolbar.• Find a term in the page – Type a term in the Find in page field in the toolbarand click Go.Other features available in the display pane are: copying information,evaluating a selection, and viewing Web pages.For More HelpIn addition to the Help browser, you can use help functions.
To get help for aspecific function, use doc. For example, doc format displays help for theformat function in the Help browser. Other means for getting help includecontacting Technical Support (http://www.mathworks.com/support) andparticipating in the newsgroup for MATLAB users, comp.soft-sys.matlab.2-10Desktop ToolsCurrent Directory BrowserMATLAB file operations use the current directory and the search path asreference points. Any file you want to run must either be in the currentdirectory or on the search path.A quick way to view or change the current directory is by using the CurrentDirectory field in the desktop toolbar as shown below.To search for, view, open, and make changes to MATLAB-related directoriesand files, use the MATLAB Current Directory browser.
Alternatively, you canuse the functions dir, cd, and delete.Use the pathname edit box to viewdirectories and their contentsClick the find button to search for content within M-filesDouble-click a fileto open it in anappropriate tool.View the helpportion of theselected M-file.2-112Development EnvironmentSearch PathTo determine how to execute functions you call, MATLAB uses a search path tofind M-files and other MATLAB-related files, which are organized indirectories on your file system. Any file you want to run in MATLAB mustreside in the current directory or in a directory that is on the search path. Bydefault, the files supplied with MATLAB and MathWorks toolboxes areincluded in the search path.To see which directories are on the search path or to change the search path,select Set Path from the File menu in the desktop, and use the Set Path dialogbox.
Alternatively, you can use the path function to view the search path,addpath to add directories to the path, and rmpath to remove directories fromthe path.Workspace BrowserThe MATLAB workspace consists of the set of variables (named arrays) builtup during a MATLAB session and stored in memory. You add variables to theworkspace by using functions, running M-files, and loading saved workspaces.To view the workspace and information about each variable, use theWorkspace browser, or use the functions who and whos.Double-clicka variable tosee andchange itscontents inthe ArrayEditor.2-12Desktop ToolsTo delete variables from the workspace, select the variable and select Deletefrom the Edit menu.
Alternatively, use the clear function.The workspace is not maintained after you end the MATLAB session. To savethe workspace to a file that can be read during a later MATLAB session, selectSave Workspace As from the File menu, or use the save function. This savesthe workspace to a binary file called a MAT-file, which has a .mat extension.There are options for saving to different formats.
To read in a MAT-file, selectImport Data from the File menu, or use the load function.Array EditorDouble-click on a variable in the Workspace browser to see it in the ArrayEditor. Use the Array Editor to view and edit a visual representation of one- ortwo-dimensional numeric arrays, strings, and cell arrays of strings that are inthe workspace.Change values of array elements.Change the display format.Use the tabs to view the variables you have open in the Array Editor.2-132Development EnvironmentEditor/DebuggerUse the Editor/Debugger to create and debug M-files, which are programs youwrite to run MATLAB functions. The Editor/Debugger provides a graphicaluser interface for basic text editing, as well as for M-file debugging.Comment selected lines and specify indenting style using the Text menu.Find and replace strings.Set breakpointswhere you wantexecution to pauseso you can examinevariables.Hold the cursor overa variable and itscurrent valueappears (known asa datatip).You can use any text editor to create M-files, such as Emacs, and can usepreferences (accessible from the desktop File menu) to specify that editor asthe default.