ebook img

Using MATLAB Graphics PDF

372 Pages·1997·9.29 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Using MATLAB Graphics

M ATLAB (cid:210) The Language of Technical Computing Computation Visualization Programming Using MATLAB Graphics Version 5.2 How to Contact The MathWorks: % 508-647-7000 Phone PHONE 508-647-7001 Fax )FAX The MathWorks, Inc. Mail MAIL 24 Prime Park Way Natick, MA 01760-1500 http://www.mathworks.com Web ftp.mathworks.com Anonymous FTP server INTERNET comp.soft-sys.matlab Newsgroup @ [email protected] Technical support E-MAIL [email protected] Product enhancement suggestions [email protected] Bug reports [email protected] Documentation error reports [email protected] Subscribing user registration [email protected] Order status, license renewals, passcodes [email protected] Sales, pricing, and general information Using MATLAB Graphics (cid:211) COPYRIGHT 1984 - 1997 by The MathWorks, Inc. All Rights Reserved. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro- duced in any form without prior written consent from The MathWorks, Inc. U.S. GOVERNMENT: If Licensee is acquiring the Programs on behalf of any unit or agency of the U.S. Government, the following shall apply: (a) For units of the Department of Defense: the Government shall have only the rights specified in the license under which the commercial computer software or commercial software documentation was obtained, as set forth in subparagraph (a) of the Rights in Commercial Computer Software or Commercial Software Documentation Clause at DFARS 227.7202-3, therefore the rights set forth herein shall apply; and (b) For any other unit or agency: NOTICE: Notwithstanding any other lease or license agreement that may pertain to, or accompany the delivery of, the computer software and accompanying documentation, the rights of the Government regarding its use, reproduction, and disclo- sure are as set forth in Clause 52.227-19 (c)(2) of the FAR. MATLAB, Simulink, Handle Graphics, and Real-Time Workshop are registered trademarks and Stateflow and Target Language Compiler are trademarks of The MathWorks, Inc. Other product or brand names are trademarks or registered trademarks of their respective holders. Printing History: December 1996First printing New for 5.0 June 1997 Revised for 5.1 (Online version) January 1998 Revised for 5.2 (Online version) Preface What Is MATLAB? . . . . . . . . . . . . . . . . . . ii MATLAB Documentation . . . . . . . . . . . . . . .iii How to Use the Documentation Set. . . . . . . . . . . . .iii Typographical and Alphabetic Conventions . . . . . . . . .iv Preface What Is MATLAB? MATLAB® is a high-performance language for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include: •Math and computation •Algorithm development •Modeling, simulation, and prototyping •Data analysis, exploration, and visualization •Scientific and engineering graphics •Application development, including graphical user interface building MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar noninteractive language such as C or Fortran. The name MATLAB stands for matrix laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects, which together represent the state-of-the-art in software for matrix computation. MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis. MATLAB features a family of application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others. ii MATLAB Documentation MATLAB Documentation MATLAB comes with an extensive set of both online and printed documenta- tion. The online MATLAB Function Reference is a compendium of all MATLAB commands functions. You can access this documentation from the MATLAB Help Desk. Users on all platforms can access the Help Desk with the MATLAB doc command. MS-Windows and Macintosh users can also access the Help Desk with the Help menu or the ? icon on the Command Window toolbar. From the Help Desk main menu, choose “MATLAB Functions” to display the Func- tion Reference. The online resources are augmented with printed documentation consisting of the following titles: •Getting Started with MATLAB describes MATLAB fundamentals. •Using MATLAB explains how to use MATLAB as both a programming lan- guage and a command-line application. •Using MATLAB Graphics describes how to use MATLAB’s graphics and visualization tools. •Building GUIs with MATLAB dicusses the construction of graphical user interfaces and introduces the Guide GUI building tool. •The MATLAB Application Programmer’s Interface Guide explains how to write C or Fortran programs that interact with MATLAB. •The MATLAB 5 New Features Guide provides information useful in making the transition from MATLAB 4.x to MATLAB 5. •The MATLAB 5 Late-Breaking News provides additional information about new features that are not covered in the other guides. They also include lists of problems fixed since the previous release and known documentation errors. How to Use the Documentation Set If you need to install MATLAB, you should read the appropriate booklet. Once you install MATLAB, you can decide which document you prefer to use to learn the MATLAB commands. If you are a new MATLAB user, you should start by reading Getting Started with MATLAB. Using MATLAB provides an extensive description of the MATLAB language. iii Preface Using MATLAB Graphics describes how to use MATLAB for visualizing data with both high-level functions and Handle Graphics. Information about con- structing user interfaces is provided in Building GUIs with MATLAB. iv Typographical and Alphabetic Conventions Typographical and Alphabetic Conventions This manual uses certain typographical conventions. Font Usage Monospace Commands, function names, and screen displays; for example, conv. Monospace Italics Names of arguments that are meant to be replaced and not typed literally; for instance: cd directory. Italics Book titles, mathematical notation, and the introduction of new terms. Boldface Initial Cap Names of keys, such as the Return key. v Preface vi Contents Preface What Is MATLAB? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii MATLAB Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii How to Use the Documentation Set . . . . . . . . . . . . . . . . . . . . . . . iii Typographical and Alphabetic Conventions . . . . . . . . . . . . . . . v Introduction 1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 High-Level Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Handle Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 Building Interactive GUIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 How It All Fits Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4 Where to Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4 Building 2-D Graphs 2 Building a 2-D Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Figure Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Multiple Axis Regions (subplot) . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Default Color Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 i Elementary Plotting Functions . . . . . . . . . . . . . . . . . . . . . . . . . 2-7 Creating a Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7 Adding Plots to an Existing Graph (hold) . . . . . . . . . . . . . . . . . 2-10 Matrix Data Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10 Imaginary and Complex Data . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12 Basic Plot Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14 Colors, Line Styles, and Markers . . . . . . . . . . . . . . . . . . . . . . . 2-14 Axis Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15 Axis Tick Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16 Axes Aspect Ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17 Graph Annotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19 Labeling the Individual Axes . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19 Building 3-D Graphs 3 Building a 3-D Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Elementary 3-D Plotting Functions . . . . . . . . . . . . . . . . . . . . . 3-3 Line Plots in 3-D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Representing a Matrix as a Surface . . . . . . . . . . . . . . . . . . . . . 3-5 Mesh and Surface Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 Visualizing Functions of Two Variables . . . . . . . . . . . . . . . . . . . 3-6 Parametric Surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Hidden Line Removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Coloring Mesh and Surface Plots . . . . . . . . . . . . . . . . . . . . . . 3-12 Colormaps and Indexed Colors . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 Truecolor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Texture Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19 Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21 Light Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-21 Properties that Affect Lighting . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 ii Contents

Description:
archy similar to that of the Handle Graphics or Simulink graphic represented. Creating Adobe Illustrator 88 files. The syntax of the command is: print –dill filename. If you do not provide a filename, MATLAB gives the file a default name based on the Figure window used to create the file. To view
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.