ISBN-13: 9781119900474 / Angielski / Miękka / 2022 / 320 str.
ISBN-13: 9781119900474 / Angielski / Miękka / 2022 / 320 str.
Preface to the Second Edition xiiiAbout the Companion Website xviiI MATLAB Programming 11 Getting Started 31.1 Running the MATLAB IDE 3Manipulating windows 51.2 MATLAB variables 5Variable assignment statements 6Variable names 7Variable workspace 81.3 Numbers and functions 81.4 Documentation 91.5 Writing simple MATLAB scripts 10Block structure 11Appropriate variable names 11Useful comments 11Units 11Formatting for clarity 12Basic display command 121.6 A few words about errors and debugging 12Error messages are your friends 13Sketch a plan on paper first 13Start small and add slowly 131.7 Using the debugger 13Looking ahead 14Programming Problems 142 Vectors and Strings 192.1 Vector basics 202.2 Operations on vectors 21Multiplication by a scalar 21Addition with a scalar 21Element-by-element operation with two vectors 21Functions of vectors 22Length of vectors 22Subarrays 23Concatenating vectors 232.3 Special vector functions 23Statistical Functions 242.4 Using rand and randi 252.5 String basics 252.6 String operations 272.7 Character vectors 292.8 Getting information from the user 30Looking ahead 31Programming Problems 313 Plotting 353.1 The plot command 35Axis scaling 38Plot labeling 393.2 Tabulating and plotting a simple function 393.3 Bar graphs and histograms 43Histograms 453.4 Drawing several plots on one graph 45Multiple plots with a single plot command 46Combining multiple plots with a hold command 48Thickening plotted curves 493.5 Adding lines and text 503.6 Changing object properties 52Looking ahead 54Programming Problems 554 Matrices 574.1 Entering and manipulating matrices 57Size of a matrix 59Matrix transpose 604.2 Operations on matrices 60Arithmetic operations with a scalar 60Addition and subtraction of two matrices of the same size 61Functions of matrices 61Matrix multiplication 62The identity matrix 62The inverse of a matrix 63The determinant of a matrix 64Matrix-vector multiplication 644.3 Solving linear systems: the backslash operator 65Extended example: solving circuit problems 65Wire segments 66Wire junctions 66Voltage sources 66Resistors 67Ground 674.4 Special matrix functions 71Looking ahead 72Programming Problems 725 Control Flow Commands 755.1 Conditional execution: the if statement 755.2 Logical expressions 795.3 Logical variables 805.4 for loops 81Good programming practice 845.5 while loops 845.6 Other control flow commands 86Switch-case statement 86Break statement 86Programming Problems 876 Animation 936.1 Basic animation 946.2 Animating function plots 986.3 Kinematics of motion 101One-dimensional motion: constant speed 101Motion with constant acceleration 104Time-marching dynamics: nonconstant force 1066.4 Looking ahead 108Programming Problems 1087 Writing Your Own MATLAB Functions 1147.1 MATLAB function files 115Declaring MATLAB functions 1157.2 Function inputs and outputs 1167.3 Local workspaces 1177.4 Multiple outputs 1177.5 Function files 1177.6 Other functional forms 118Subfunctions 118Nested functions 122Anonymous functions 1227.7 Optional arguments for functions 1237.8 Looking forward 124Programming Problems 1258 More MATLAB Data Classes and Structures 1328.1 Cell arrays 1328.2 Structures 1338.3 Complex numbers 1348.4 Function handles 1358.5 Tables 1358.6 Other data classes and data structures 136Programming Problems 137II Building Gui Tools 1399 Building GUI Tools with App Designer 1419.1 The App Designer interface 1429.2 Getting started: HelloTool 1449.3 Components communicating: SliderTool 1489.4 Transforming a MATLAB program into a GUI tool: DampedEfieldTool 150Step0: Write and debug the program 151Step1: Plan the GUI 152Step 2: Create the GUI in App Designer 153Step 3: Connect program inputs and outputs to the GUI components 155Step 4: Add callbacks to invoke the primary model function 1579.5 Test and improve 157Many ways to do things 159Key points from this chapter 159Programming Problems 16010 More GUI Techniques 16810.1 Sharing data between callbacks 16910.2 More GUI components 170Text and Numeric Edit Fields 170Drop Down 171Check Box 171Label 172List Box 172Radio Button Group 173Image 173Communicating user choices 173Tab Group 174Menu bar 174Toolbar 176Text Area 176The uses of invisibility 17610.3 Popups 176Progress dialogue 176Wait bar 178Input dialogue 178Confirm dialogue 17910.4 Responding to keyboard input 18110.5 Mouse events and object dragging 181III Advanced Topics 18711 More Graphics 18911.1 Logarithmic plots 18911.2 Plotting functions on two axes 19211.3 Plotting surfaces 19411.4 Plotting vector fields 19911.5 Working with images 200Importing and manipulating bit-mapped images 200Placing images on surface objects 20711.6 Rotating composite objects in three dimensions 20912 More Mathematics 21312.1 Derivatives 214Derivatives of mathematical functions expressed as MATLAB functions 214Derivatives of tabulated functions 21512.2 Integration 218Integrating tabulated functions 218Integrating mathematical functions expressed as MATLAB functions 22112.3 Zeros of a function of one variable 22512.4 Function minimization 227Finding a minimum of a function of one variable 227Multidimensional minimization 229Fitting to an arbitrary function by multidimensional minimization 229Solving simultaneous nonlinear equations by multidimensional minimization 23312.5 Solving ordinary differential equations 235Plotting a slope field 23812.6 Eigenvalues and eigenvectors 23913 Reading and Writing Files 24213.1 Saving and loading data in .mat files 24213.2 Reading and writing spreadsheet files 24413.3 Writing text files 245The write matrix command 245Writing formatted text files 246Formatting a string using sprintf 24913.4 Reading data from a text file 249Reading into a cell array 250Reading complicated text data files 25013.5 A GUI interface to filenames using uiputfile and uigetfile 252Appendix Using latex Commands 255Index 261
Craig S. Lent is The Frank M. Freimann Professor of Electrical Engineering at the University of Notre Dame, Indiana, USA. Professor Lent received his bachelor's degree in Physics from the University of California at Berkeley, USA, and his doctorate in Physics from the University of Minnesota, Minneapolis, USA. Professor Lent has been a member of the Notre Dame faculty since 1986. His research is in the area of quantum devices, quantum information theory, and molecular-scale devices.
1997-2024 DolnySlask.com Agencja Internetowa