ebook img

Matlab For Dummies PDF

436 Pages·2015·8.2 MB·english
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 Matlab For Dummies

MATLAB® MATLAB® by Jim Sizemore and John Paul Mueller MATLAB® For Dummies® Published by: John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030-5774, www.wiley.com Copyright © 2015 by John Wiley & Sons, Inc., Hoboken, New Jersey Published simultaneously in Canada No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without the prior writ- ten permission of the Publisher. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Trademarks: Wiley, For Dummies, the Dummies Man logo, Dummies.com, Making Everything Easier, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and may not be used without written permission. MATLAB is a registered trademark of Mathworks, Inc. All other trade- marks are the property of their respective owners. John Wiley & Sons, Inc. is not associated with any product or vendor mentioned in this book. LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REPRESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CONTENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITH- OUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PROFESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMATION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ. For general information on our other products and services, please contact our Customer Care Department within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993, or fax 317-572-4002. For technical support, please visit www.wiley.com/techsupport. Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com. Library of Congress Control Number: 2014940494 ISBN: 978-1-118-882010-0 (pbk); ISBN 978-1-118-82003-2 (ebk); ISBN 978-1-118-82434-4 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 Contents at a Glance Introduction ................................................................ 1 Part I: Getting Started With MATLAB............................ 5 Chapter 1: Introducing MATLAB and Its Many Uses .....................................................7 Chapter 2: Starting Your Copy of MATLAB ..................................................................19 Chapter 3: Interacting with MATLAB ............................................................................37 Chapter 4: Starting, Storing, and Saving MATLAB Files ..............................................59 Part II: Manipulating and Plotting Data in MATLAB .... 79 Chapter 5: Embracing Vectors, Matrices, and Higher Dimensions ...........................81 Chapter 6: Understanding Plotting Basics ..................................................................115 Chapter 7: Using Advanced Plotting Features............................................................135 Part III: Streamlining MATLAB ................................. 151 Chapter 8: Automating Your Work ..............................................................................153 Chapter 9: Expanding MATLAB’s Power with Functions ..........................................171 Chapter 10: Adding Structure to Your Scripts ...........................................................193 Part IV: Employing Advanced MATLAB Techniques..... 213 Chapter 11: Importing and Exporting Data .................................................................215 Chapter 12: Printing and Publishing Your Work ........................................................233 Chapter 13: Recovering from Mistakes .......................................................................257 Part V: Specific MATLAB Applications ...................... 277 Chapter 14: Solving Equations and Finding Roots .....................................................279 Chapter 15: Performing Analysis .................................................................................307 Chapter 16: Creating Super Plots .................................................................................319 Part VI: The Part of Tens .......................................... 351 Chapter 17: Top Ten Uses of MATLAB ........................................................................353 Chapter 18: Ten Ways to Make a Living Using MATLAB ...........................................361 Appendix A: MATL AB Functions .................................................................................367 Appendix B: MATLAB’s Plotting Routines ..................................................................377 Index ...................................................................... 385 Table of Contents Introduction ................................................................. 1 About This Book ..............................................................................................1 Foolish Assumptions .......................................................................................2 Icons Used in This Book .................................................................................3 Beyond the Book .............................................................................................3 Where to Go from Here ...................................................................................4 Part I: Getting Started With MATLAB ............................ 5 Chapter 1: Introducing MATLAB and Its Many Uses . . . . . . . . . . . . . . . 7 Putting MATLAB in Its Place ..........................................................................8 Understanding how MATLAB relates to a Turing machine ..............8 Using MATLAB as more than a calculator ........................................10 Determining why you need MATLAB ................................................11 Discovering Who Uses MATLAB for Real-World Tasks ............................13 Knowing How to Get the Most from MATLAB ...........................................14 Getting the basic computer skills ......................................................15 Defining the math requirements ........................................................15 Applying what you know about other procedural languages ........16 Understanding how this book will help you .....................................16 Getting Over the Learning Curve .................................................................17 Chapter 2: Starting Your Copy of MATLAB . . . . . . . . . . . . . . . . . . . . . . . 19 Installing MATLAB .........................................................................................19 Discovering which platforms MATLAB supports ............................19 Getting your copy of MATLAB ...........................................................20 Performing the installation .................................................................21 Activating the product ........................................................................21 Meeting the MATLAB Interface ....................................................................22 Starting MATLAB for the first time ....................................................22 Employing the Command window .....................................................24 Using the Current Folder toolbar .......................................................27 Viewing the Current Folder window ..................................................28 Changing the MATLAB layout ............................................................33 viii MATLAB For Dummies Chapter 3: Interacting with MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Using MATLAB as a Calculator ....................................................................38 Entering information at the prompt ..................................................38 Entering a formula ...............................................................................40 Copying and pasting formulas ...........................................................41 Changing the Command window formatting ....................................42 Suppressing Command window output ............................................44 Understanding the MATLAB Math Syntax ..................................................44 Adding, subtracting, multiplying, and dividing ................................45 Working with exponents .....................................................................47 Organizing Your Storage Locker ..................................................................48 Using ans — the default storage locker ............................................48 Creating your own storage lockers....................................................48 Operating MATLAB as More Than a Calculator ........................................50 Learning the truth ................................................................................50 Using the built-in functions ................................................................52 Accessing the function browser ........................................................52 Recovering from Mistakes ............................................................................54 Understanding the MATLAB error messages ...................................54 Stopping MATLAB when it hangs ......................................................55 Getting Help ....................................................................................................55 Exploring the documentation .............................................................56 Working through the examples ..........................................................56 Relying on peer support .....................................................................57 Obtaining training ................................................................................57 Requesting support from MathWorks ...............................................58 Contacting the authors .......................................................................58 Chapter 4: Starting, Storing, and Saving MATLAB Files . . . . . . . . . . . 59 Examining MATLAB’s File Structure ...........................................................60 Understanding the MATLAB files and what they do .......................60 Exploring folders with the GUI ...........................................................61 Exploring folders with commands .....................................................65 Working with files in MATLAB ...........................................................69 Accessing and Sharing MATLAB Files .........................................................72 Opening .................................................................................................72 Importing ..............................................................................................73 Exporting ...............................................................................................75 Saving Your Work ..........................................................................................76 Saving variables with the GUI .............................................................76 Saving variables using commands .....................................................77 Saving commands with the GUI .........................................................77 Saving commands using commands .................................................77

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.