Details

Learning to Program with MATLAB


Learning to Program with MATLAB

Building GUI Tools
2. Aufl.

von: Craig S. Lent

76,99 €

Verlag: Wiley
Format: EPUB
Veröffentl.: 27.07.2022
ISBN/EAN: 9781119900498
Sprache: englisch
Anzahl Seiten: 288

DRM-geschütztes eBook, Sie benötigen z.B. Adobe Digital Editions und eine Adobe ID zum Lesen.

Beschreibungen

<b>Learning to Program with MATLAB</b> <p><b>Introductory text integrating science, mathematics, and engineering to give a basic understanding of the fundamentals of computer programming with MATLAB</b> <p><i>Learning to Program with MATLAB: Building GUI Tools, Second Edition</i> serves as a compact introduction to computer programming using the MATLAB language, covering elements of both program and graphical user interface (GUI) design to enable readers to create computer programs just like the ones they are accustomed to interacting with. Rather than being encyclopedic in scope, the goal of the text is to describe what users will find most useful and point to other features. Descriptions and examples of some of the most useful functions are included throughout, particularly with regards to engineering and science applications. The work also includes updated videos and problem solutions on an instructor companion website. <p>The first edition of <i>Learning to Program with MATLAB</i> employed the MATLAB graphical user interface design environment (GUIDE) to develop the GUI tools. The second edition is based on the new and improved App Designer program, which has supplanted GUIDE. This edition includes: <ul><li>Core concepts of computer programming using MATLAB, such as arrays, loops, functions, and basic data structures</li> <li>How to write your own MATLAB functions, covering topics such as local workspaces, multiple outputs, function files, and other functional forms</li> <li>The new string class and table class, some new features of function arguments, and re-written sections for building GUI tools with App Designer</li> <li>Syntax for graphics and App Designer features, plus examples demonstrating the new way to handle string information</li></ul> <p>Starting with the basics and building up to an emphasis on GUI tools, <i>Learning to Program with MATLAB</i> is a comprehensive introduction to programming in a robust and multipurpose language, making it an ideal classroom resource for both students and instructors in related programs of study.
<p>Preface to the Second Edition xiii</p> <p>About the Companion Website xvii</p> <p>I MATLAB Programming 1</p> <p><b>1 Getting Started 3</b></p> <p>1.1 Running the MATLAB IDE 3</p> <p>Manipulating windows 5</p> <p>1.2 MATLAB variables 5</p> <p>Variable assignment statements 6</p> <p>Variable names 7</p> <p>Variable workspace 8</p> <p>1.3 Numbers and functions 8</p> <p>1.4 Documentation 9</p> <p>1.5 Writing simple MATLAB scripts 10</p> <p>Block structure 11</p> <p>Appropriate variable names 11</p> <p>Useful comments 11</p> <p>Units 11</p> <p>Formatting for clarity 12</p> <p>Basic display command 12</p> <p>1.6 A few words about errors and debugging 12</p> <p>Error messages are your friends 13</p> <p>Sketch a plan on paper first 13</p> <p>Start small and add slowly 13</p> <p>1.7 Using the debugger 13</p> <p>Looking ahead 14</p> <p>Programming Problems 14</p> <p><b>2 Vectors and Strings 19</b></p> <p>2.1 Vector basics 20</p> <p>2.2 Operations on vectors 21</p> <p>Multiplication by a scalar 21</p> <p>Addition with a scalar 21</p> <p>Element-by-element operation with two vectors 21</p> <p>Functions of vectors 22</p> <p>Length of vectors 22</p> <p>Subarrays 23</p> <p>Concatenating vectors 23</p> <p>2.3 Special vector functions 23</p> <p>Statistical Functions 24</p> <p>2.4 Using rand and randi 25</p> <p>2.5 String basics 25</p> <p>2.6 String operations 27</p> <p>2.7 Character vectors 29</p> <p>2.8 Getting information from the user 30</p> <p>Looking ahead 31</p> <p>Programming Problems 31</p> <p><b>3 Plotting 35</b></p> <p>3.1 The plot command 35</p> <p>Axis scaling 38</p> <p>Plot labeling 39</p> <p>3.2 Tabulating and plotting a simple function 39</p> <p>3.3 Bar graphs and histograms 43</p> <p>Histograms 45</p> <p>3.4 Drawing several plots on one graph 45</p> <p>Multiple plots with a single plot command 46</p> <p>Combining multiple plots with a hold command 48</p> <p>Thickening plotted curves 49</p> <p>3.5 Adding lines and text 50</p> <p>3.6 Changing object properties 52</p> <p>Looking ahead 54</p> <p>Programming Problems 55</p> <p><b>4 Matrices 57</b></p> <p>4.1 Entering and manipulating matrices 57</p> <p>Size of a matrix 59</p> <p>Matrix transpose 60</p> <p>4.2 Operations on matrices 60</p> <p>Arithmetic operations with a scalar 60</p> <p>Addition and subtraction of two matrices of the same size 61</p> <p>Functions of matrices 61</p> <p>Matrix multiplication 62</p> <p>The identity matrix 62</p> <p>The inverse of a matrix 63</p> <p>The determinant of a matrix 64</p> <p>Matrix–vector multiplication 64</p> <p>4.3 Solving linear systems: the backslash operator 65</p> <p>Extended example: solving circuit problems 65</p> <p>Wire segments 66</p> <p>Wire junctions 66</p> <p>Voltage sources 66</p> <p>Resistors 67</p> <p>Ground 67</p> <p>4.4 Special matrix functions 71</p> <p>Looking ahead 72</p> <p>Programming Problems 72</p> <p><b>5 Control Flow Commands 75</b></p> <p>5.1 Conditional execution: the if statement 75</p> <p>5.2 Logical expressions 79</p> <p>5.3 Logical variables 80</p> <p>5.4 for loops 81</p> <p>Good programming practice 84</p> <p>5.5 while loops 84</p> <p>5.6 Other control flow commands 86</p> <p>Switch-case statement 86</p> <p>Break statement 86</p> <p>Programming Problems 87</p> <p><b>6 Animation 93</b></p> <p>6.1 Basic animation 94</p> <p>6.2 Animating function plots 98</p> <p>6.3 Kinematics of motion 101</p> <p>One-dimensional motion: constant speed 101</p> <p>Motion with constant acceleration 104</p> <p>Time-marching dynamics: nonconstant force 106</p> <p>6.4 Looking ahead 108</p> <p>Programming Problems 108</p> <p><b>7 Writing Your Own MATLAB Functions 114</b></p> <p>7.1 MATLAB function files 115</p> <p>Declaring MATLAB functions 115</p> <p>7.2 Function inputs and outputs 116</p> <p>7.3 Local workspaces 117</p> <p>7.4 Multiple outputs 117</p> <p>7.5 Function files 117</p> <p>7.6 Other functional forms 118</p> <p>Subfunctions 118</p> <p>Nested functions 122</p> <p>Anonymous functions 122</p> <p>7.7 Optional arguments for functions 123</p> <p>7.8 Looking forward 124</p> <p>Programming Problems 125</p> <p><b>8 More MATLAB Data Classes and Structures 132</b></p> <p>8.1 Cell arrays 132</p> <p>8.2 Structures 133</p> <p>8.3 Complex numbers 134</p> <p>8.4 Function handles 135</p> <p>8.5 Tables 135</p> <p>8.6 Other data classes and data structures 136</p> <p>Programming Problems 137</p> <p>II Building Gui Tools 139</p> <p><b>9 Building GUI Tools with App Designer 141</b></p> <p>9.1 The App Designer interface 142</p> <p>9.2 Getting started: HelloTool 144</p> <p>9.3 Components communicating: SliderTool 148</p> <p>9.4 Transforming a MATLAB program into a GUI tool: DampedEfieldTool 150</p> <p>Step0: Write and debug the program 151</p> <p>Step1: Plan the GUI 152</p> <p>Step 2: Create the GUI in App Designer 153</p> <p>Step 3: Connect program inputs and outputs to the GUI components 155</p> <p>Step 4: Add callbacks to invoke the primary model function 157</p> <p>9.5 Test and improve 157</p> <p>Many ways to do things 159</p> <p>Key points from this chapter 159</p> <p>Programming Problems 160</p> <p><b>10 More GUI Techniques 168</b></p> <p>10.1 Sharing data between callbacks 169</p> <p>10.2 More GUI components 170</p> <p>Text and Numeric Edit Fields 170</p> <p>Drop Down 171</p> <p>Check Box 171</p> <p>Label 172</p> <p>List Box 172</p> <p>Radio Button Group 173</p> <p>Image 173</p> <p>Communicating user choices 173</p> <p>Tab Group 174</p> <p>Menu bar 174</p> <p>Toolbar 176</p> <p>Text Area 176</p> <p>The uses of invisibility 176</p> <p>10.3 Popups 176</p> <p>Progress dialogue 176</p> <p>Wait bar 178</p> <p>Input dialogue 178</p> <p>Confirm dialogue 179</p> <p>10.4 Responding to keyboard input 181</p> <p>10.5 Mouse events and object dragging 181</p> <p>III Advanced Topics 187</p> <p><b>11 More Graphics 189</b></p> <p>11.1 Logarithmic plots 189</p> <p>11.2 Plotting functions on two axes 192</p> <p>11.3 Plotting surfaces 194</p> <p>11.4 Plotting vector fields 199</p> <p>11.5 Working with images 200</p> <p>Importing and manipulating bit-mapped images 200</p> <p>Placing images on surface objects 207</p> <p>11.6 Rotating composite objects in three dimensions 209</p> <p><b>12 More Mathematics 213</b></p> <p>12.1 Derivatives 214</p> <p>Derivatives of mathematical functions expressed as MATLAB functions 214</p> <p>Derivatives of tabulated functions 215</p> <p>12.2 Integration 218</p> <p>Integrating tabulated functions 218</p> <p>Integrating mathematical functions expressed as MATLAB functions 221</p> <p>12.3 Zeros of a function of one variable 225</p> <p>12.4 Function minimization 227</p> <p>Finding a minimum of a function of one variable 227</p> <p>Multidimensional minimization 229</p> <p>Fitting to an arbitrary function by multidimensional minimization 229</p> <p>Solving simultaneous nonlinear equations by multidimensional minimization 233</p> <p>12.5 Solving ordinary differential equations 235</p> <p>Plotting a slope field 238</p> <p>12.6 Eigenvalues and eigenvectors 239</p> <p><b>13 Reading and Writing Files 242</b></p> <p>13.1 Saving and loading data in .mat files 242</p> <p>13.2 Reading and writing spreadsheet files 244</p> <p>13.3 Writing text files 245</p> <p>The write matrix command 245</p> <p>Writing formatted text files 246</p> <p>Formatting a string using sprintf 249</p> <p>13.4 Reading data from a text file 249</p> <p>Reading into a cell array 250</p> <p>Reading complicated text data files 250</p> <p>13.5 A GUI interface to filenames using uiputfile and uigetfile 252</p> <p>Appendix Using latex Commands 255</p> <p>Index 261</p>
<p><b>Craig S. Lent</b> 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.
<p><b>Introductory text integrating science, mathematics, and engineering to give a basic understanding of the fundamentals of computer programming with MATLAB</b> <p><i>Learning to Program with MATLAB: Building GUI Tools, Second Edition</i> serves as a compact introduction to computer programming using the MATLAB language, covering elements of both program and graphical user interface (GUI) design to enable readers to create computer programs just like the ones they are accustomed to interacting with. Rather than being encyclopedic in scope, the goal of the text is to describe what users will find most useful and point to other features. Descriptions and examples of some of the most useful functions are included throughout, particularly with regards to engineering and science applications. The work also includes updated videos and problem solutions on an instructor companion website. <p>The first edition of <i>Learning to Program with MATLAB</i> employed the MATLAB graphical user interface design environment (GUIDE) to develop the GUI tools. The second edition is based on the new and improved App Designer program, which has supplanted GUIDE. This edition includes: <ul><li>Core concepts of computer programming using MATLAB, such as arrays, loops, functions, and basic data structures</li> <li>How to write your own MATLAB functions, covering topics such as local workspaces, multiple outputs, function files, and other functional forms</li> <li>The new string class and table class, some new features of function arguments, and re-written sections for building GUI tools with App Designer</li> <li>Syntax for graphics and App Designer features, plus examples demonstrating the new way to handle string information</li></ul> <p>Starting with the basics and building up to an emphasis on GUI tools, <i>Learning to Program with MATLAB</i> is a comprehensive introduction to programming in a robust and multipurpose language, making it an ideal classroom resource for both students and instructors in related programs of study.

Diese Produkte könnten Sie auch interessieren:

OLED Display Fundamentals and Applications
OLED Display Fundamentals and Applications
von: Takatoshi Tsujimura
EPUB ebook
90,99 €
Classification, Parameter Estimation and State Estimation
Classification, Parameter Estimation and State Estimation
von: Bangjun Lei, Guangzhu Xu, Ming Feng, Yaobin Zou, Ferdinand van der Heijden, Dick de Ridder, David M. J. Tax
PDF ebook
101,99 €