E-Book, Englisch, 544 Seiten
Eshkabilov Beginning MATLAB and Simulink
1. Auflage 2019
ISBN: 978-1-4842-5061-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
From Novice to Professional
E-Book, Englisch, 544 Seiten
Reihe: Professional and Applied Computing (R0)
ISBN: 978-1-4842-5061-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Employ essential and hands-on tools and functions of the MATLAB and Simulink packages, which are explained and demonstrated via interactive examples and case studies. This book contains dozens of simulation models and solved problems via m-files/scripts and Simulink models which help you to learn programming and modeling essentials. You'll become efficient with many of the built-in tools and functions of MATLAB/Simulink while solving engineering and scientific computing problems.
Beginning MATLAB and Simulink explains various practical issues of programming and modelling in parallel by comparing MATLAB and Simulink. After reading and using this book, you'll be proficient at using MATLAB and applying the source code from the book's examples as templates for your own projects in data science or engineering.
What You Will LearnGet started using MATLAB and SimulinkCarry out data visualization with MATLABGain the programming and modeling essentials of MATLABBuild a GUI with MATLABWork with integration and numerical root finding methodsApply MATLAB to differential equations-based models and simulationsUse MATLAB for data science projects
Who This Book Is For
Engineers, programmers, data scientists, and students majoring in engineering and scientific computing.
Sulaymon L. Eshkabilov, PhD is currently a visiting professor at the Department of Agriculture and Biosystems, North Dakota State University, USA. He obtained his ME diploma from Tashkent Automobile Road Institute, his MSc from Rochester Institute of Technology, NY, USA and his PhD from Cybernetics Institute of Academy Sciences of Uzbekistan in 1994, 2001 and 2005, respectively. He was an associate professor at Tashkent Automobile Road Institute for December 2006 - January 2017. He also held visiting professor and researcher positions at Ohio University, USA for 2010/2011 and Johannes Kepler University, Austria in January - September 2017. He teaches courses: 'MATLAB/Simulink applications for mechanical engineering and numerical analysis' and 'Modeling of Engineering Systems' for undergraduate students, 'Advanced MATLAB/Mechatronics' seminar/class, 'Control applications', 'System identification', 'Experimentation and testing with analog and digital devices' for graduate students.
His research areas are mechanical vibrations, control, mechatronics and system dynamics. He is an author of over 30 research papers published in peer reviewed journals and conference proceedings in the USA, UK, Uzbekistan, Portugal, Russian Federation, India, Germany and Egypt, and four books published in the USA, Uzbekistan and Sweden. Two of the four books are devoted to MATLAB/Simulink applications for mechanical engineering students and numerical analysis. He has worked as an external academic expert in the European Commission to assess academic projects for 2009 - 2018 and coordinated/authored five institutional joint European projects funded by the European Commission for 2003 - 2016 that involved over two dozen universities from Uzbekistan, UK, Sweden, Italy, Austria, Spain, Portugal, Romania and Belgium.
Autoren/Hrsg.
Weitere Infos & Material
1;Table of Contents;5
2;About the Author;17
3;About the Technical Reviewers;18
4;Acknowledgments;20
5;Introduction;21
6;Chapter 1: Introduction to MATLAB;24
6.1;MATLAB’s Menu Panel and Help;24
6.2;The MATLAB Environment;30
6.3;Working in the Command Window;32
6.4;Command Window and Variables;34
6.4.1;Using Variables;34
6.4.2;When to Use the Command Window;41
6.5;Different Variables and Data Sets in MATLAB;46
6.5.1;Numerical Data/Arrays;48
6.5.2;NaN (Not-a-Number);56
6.5.3;Character Types of Variables;61
6.5.4;Function Handle;63
6.5.5;Logical Arrays;67
6.5.6;Table Arrays;71
6.5.7;Cell Arrays;73
6.5.8;Structure Arrays;77
6.5.9;Complex Numbers;82
6.5.10;Precision;82
6.6;M-File and MLX–File Editors;83
6.6.1;M-File Editor;83
6.6.2;MLX-File Editor;85
6.6.2.1;% Comments;88
6.7;Closing the MATLAB Window;95
6.8;Summary;95
6.9;References;95
6.10;Exercises for Self-Testing;96
6.10.1;Exercise 1;96
6.10.2;Exercise 2;96
6.10.3;Exercise 3;96
6.10.4;Exercise 4;97
6.10.5;Exercise 5;97
6.10.6;Exercise 6;97
6.10.7;Exercise 7;97
6.10.8;Exercise 8;97
6.10.9;Exercise 9;97
6.10.10;Exercise 10;98
6.10.11;Exercise 11;98
6.10.12;Exercise 12;98
6.10.13;Exercise 13;99
6.10.14;Exercise 14;99
6.10.15;Exercise 15;99
6.10.16;Exercise 16;100
6.10.17;Exercise 17;100
6.10.18;Exercise 18;100
6.10.19;Exercise 19;100
6.10.20;Exercise 20;100
6.10.21;Exercise 21;101
6.10.22;Exercise 22;101
6.10.23;Exercise 23;101
6.10.24;Exercise 24;102
6.10.25;Exercise 25;102
6.10.26;Exercise 26;103
6.10.27;Exercise 27;103
6.10.28;Exercise 28;103
6.10.29;Exercise 29;103
6.10.30;Exercise 30;103
6.10.31;Exercise 31;104
6.10.32;Exercise 32;105
6.10.33;Exercise 33;105
6.10.34;Exercise 34;106
6.10.35;Exercise 35;106
6.10.36;Exercise 36;106
6.10.37;Exercise 37;107
6.10.38;Exercise 38;107
6.10.39;Exercise 39;107
6.10.40;Exercise 40;108
6.10.41;Exercise 41;109
6.10.42;Exercise 42;110
6.10.43;Exercise 43;112
6.10.44;Exercise 44;112
7;Chapter 2: Programming Essentials;113
7.1;Writing M/MLX-Files;113
7.1.1;How to Create an M/MLX-File;116
7.1.2;Warnings in Scripts;116
7.1.3;Errors in Scripts;120
7.1.3.1;Example 1;120
7.1.3.2;Example 2;123
7.1.3.3;Example 3;125
7.1.3.4;Example 4;127
7.1.3.5;Example 5;130
7.1.4;Cell Mode;135
7.1.5;Debugging Mode;139
7.1.6;M-Lint Code Check;140
7.1.7;Code Profiling;140
7.1.8;Dependency Report;141
7.1.9;P-Codes;141
7.1.10;Some Remarks About Scripts/M/MLX-Files;143
7.2;Display and Printout Operators: display, sprintf, and fprintf;143
7.2.1;Example 1;144
7.2.2;Example 2;145
7.2.3;fprintf();146
7.3;The if, else, elseif, end and switch, case, end Control Statements;152
7.3.1;Example 1;154
7.3.2;Example 2;155
7.3.3;Example 3;157
7.3.3.1;Case 1;160
7.3.3.2;Case 2;161
7.3.3.3;Case 3;161
7.3.4;Example 4;162
7.4;Loop Control Statements: while, for, continue, break, and end;163
7.4.1;Example 1;164
7.4.2;Example 2;165
7.4.3;Example 3;169
7.4.4;Example 4;172
7.4.5;Example 5;173
7.4.6;Example 6;176
7.4.7;Example 7;179
7.4.8;Example 8;180
7.4.9;Memory Allocation;181
7.4.10;Example 9;182
7.4.11;Example 10;184
7.4.12;Example 11;185
7.4.13;Example 12;187
7.4.14;Example 13;189
7.4.15;Example 14;194
7.4.16;Example 15;197
7.4.17;Example 16;198
7.5;Symbol References in Programming;200
7.5.1;Asterisk;201
7.5.2;At (@) Sign;201
7.5.3;Colon;202
7.5.4;Comma;202
7.5.5;Curly Brackets;202
7.5.6;Dollar Sign;203
7.5.7;Dot;203
7.5.8;Dot-Dot;203
7.5.9;Dot-Dot-Dot (Ellipsis);203
7.5.10;Parentheses;204
7.5.11;Percent;204
7.5.12;Semicolon;205
7.5.13;Single Quotes;206
7.5.14;Slash and Backslash;206
7.5.15;Square Brackets;206
7.6;Function Files;207
7.6.1;Example 1;209
7.6.2;Example 2;211
7.6.3;Example 3;212
7.6.4;Example 4;213
7.6.5;Most Common Errors with Function Files;216
7.6.6;Varying Number of Inputs and Outputs;218
7.6.6.1;Example 5;219
7.6.6.2;Example 6;221
7.6.6.3;Example 7;224
7.6.6.3.1;Task 1;224
7.6.6.3.2;Task 2;225
7.6.7;Nested and Sub-Functions of Function Files;234
7.6.7.1;Example 8;235
7.6.8;Function Files Within M-Files;237
7.6.8.1;Example 9;237
7.6.9;Summary of Scripts and Function Files;239
7.7;Inline Functions;240
7.7.1;Example 1;240
7.7.2;Example 2;241
7.7.3;Example 3;241
7.8;Anonymous Functions with Handles (@);242
7.8.1;Example 1;242
7.8.2;Example 2;243
7.8.3;Example 3;243
7.9;How to Improve Script Performance;244
8;Chapter 3: Graphical User Interface Model Development;245
8.1;GUIDE;245
8.1.1;Example 1: Building a 2D Plot;250
8.1.2;Example 2: Adding Functionality;257
8.1.3;Example 3: Solving a Quadratic Equation;260
8.1.3.1;Building the GUI;260
8.1.3.2;Editing the Callback Functions;263
8.2;GUI Dialogs and Message Boxes;268
8.2.1;Error Dialog;269
8.2.2;Warning Message;269
8.2.3;F1 Help/Message Box;269
8.2.4;General Syntax;271
8.2.5;Input Dialog;272
8.2.6;Question Dialog;272
8.2.6.1;Making a Choice;273
8.2.6.2;Providing Input to an Equation;277
9;Chapter 4: MEX Files, C/C++, and Standalone Applications;280
9.1;Verifying Compilers;281
9.2;Generating C Code;281
9.3;Creating MEX Files from Other Languages;288
9.4;Building Standalone Applications;289
10;Chapter 5: Simulink Modeling Essentials;295
10.1;Simulink Modeling;295
10.1.1;Example: Arithmetic Calculations;297
10.1.2;Example: Modeling Simple Arithmetic Operations;301
10.1.3;Performing Matrix Operations;305
10.1.4;Computing Values of Functions;310
10.1.5;Input/Output Signals from/to the MATLAB Workspace;317
10.1.6;Simulating a Mechanical System;320
10.1.7;Working with a Second Order Differential Equation;328
10.2;Simulink Model Analysis and Diagnostics;333
10.2.1;Code Generation;334
10.2.2;Model Advisor;335
10.3;Summary;341
10.4;Exercises for Self-Testing;341
10.4.1;Exercise 1;341
10.4.2;Exercise 2;341
10.4.3;Exercise 3;342
10.4.4;Exercise 4;342
10.4.5;Exercise 5;343
10.4.6;Exercise 6;344
10.4.7;Exercise 7;344
10.4.8;Exercise 8;345
10.4.9;Exercise 9;346
10.4.10;Exercise 10;347
10.4.11;Exercise 11;348
10.4.12;Exercise 12;349
10.4.13;Exercise 13;350
10.4.14;Exercise 14;351
10.4.15;Exercise 15;351
10.4.16;Exercise 16;352
10.4.17;Exercise 17;352
10.4.18;Exercise 18;353
10.4.19;Exercise 19;353
10.4.20;Exercise 20;354
10.4.21;Exercise 21;354
10.4.22;Exercise 22;355
10.4.23;Exercise 23;355
10.4.24;Exercise 24;356
10.4.25;Exercise 25;357
10.4.26;Exercise 26;357
10.4.27;Exercise 27;358
10.4.28;Exercise 28;358
10.4.29;Exercise 29;359
10.4.30;Exercise 30;360
10.4.31;Exercise 31;361
10.4.32;Exercise 32;361
10.4.33;Exercise 33;362
10.4.34;Exercise 34;362
10.4.35;Exercise 35;362
11;Chapter 6: Plots and Data Visualization;363
11.1;Basics of Plot Building;363
11.1.1;PLOT();364
11.1.2;Example 1: Plotting Two Rows of Data;364
11.1.3;Example 2: Plotting Function Values;365
11.1.4;Example 3: Building a Histogram;367
11.1.5;TITLE, XLABEL, YLABEL, AXIS, GRID, and LEGEND;368
11.1.5.1;TITLE();368
11.1.5.2;XLABEL, YLABEL, and ZLABEL;368
11.1.5.3;AXIS;368
11.1.5.4;GRID;369
11.1.6;Example 4: Plotting a Unit Circle with Plot Tools;369
11.1.7;LINE and MARKER Specifiers;370
11.1.8;Example 5: Plotting Sine Function Values with Plot Tools;373
11.1.8.1;Special Characters;374
11.1.9;Example 6: Plotting Sine Function Values with Plot Tools;375
11.2;Plot Two Data Sets in Two Y–Y Axes;376
11.2.1;Example 7: Plotting Two Function Values on Y-Y Axes;376
11.3;Sub-plots;379
11.3.1;Example 8: Building Sub-Plots of Functions;379
11.4;LEGEND;381
11.5;HOLD;381
11.5.1;Example 9: Plotting a Few Function Values in One Plot;381
11.5.2;Example 10: Plotting Function Values with Different Line Markers and Colors;382
11.6;EZPLOT, FPLOT, and FIMPLICIT with Function Handles (@);384
11.6.1;Example 11: Plotting a Mathematical Expression with ezplot();384
11.7;GTEXT, TEXT, and GINPUT;385
11.7.1;Example 12: Locate and Display Minimum Values of a Function Plot in a Plot Figure;386
11.8;Axis Ticks and Tick Labels;388
11.8.1;Example 13: Display X-Axis Tick Labels;389
11.9;Figure Handles;390
11.9.1;Example 14: Working with Figure Handles;390
11.10;3D Surface Plots;392
11.10.1;Example 15: Creating a 3D Pie Plot with pie();392
11.10.2;Example 16: Creating a 3D Surface Plot with ezsurf();393
11.10.3;Example 17: Creating a 3D Mesh Plot with ezmesh();394
11.10.4;Example 18: Creating a 3D Surface-Contour Plot with ezsurfc();394
11.10.5;Example 19: Creating a 3D Plot of an Electric Potential Field;395
11.10.6;Example 20: Creating 3D Plots with waterfall() and ribbon();398
11.11;3D Line Plots and Animations;400
11.11.1;Example 21: Building 3D Line Plots and Animated 3D Line Plots with plot3(), comet3(), and ezplot3();400
11.12;Animated Plots;402
11.12.1;Example 22: Building an Animated Plot with getframe();402
11.12.2;Example 23: Building an Animated Plot with drawnow;403
11.12.3;Example 24: Building an Animated Plot with drawnow;403
11.12.4;Example 25: Building an Animated Plot of a Projectile with getframe();404
11.13;Summary;405
11.14;Exercises for Self-Testing;406
11.14.1;Exercise 1;406
11.14.2;Exercise 2;407
11.14.3;Exercise 3;407
11.14.4;Exercise 4;407
11.14.5;Exercise 5;408
11.14.6;Exercise 6;409
11.14.7;Exercise 7;409
11.14.8;Exercise 8;409
11.14.9;Exercise 9;410
11.14.10;Exercise 10;410
11.14.11;Exercise 11;410
11.14.12;Exercise 12;411
11.14.13;Exercise 13;411
11.14.14;Exercise 14;411
11.14.15;Exercise 15;411
11.14.16;Exercise 16;412
11.14.17;Exercise 17;412
11.14.18;Exercise 18;413
11.14.19;Exercise 19;413
11.14.20;Exercise 20;414
11.14.21;Exercise 21;414
11.14.22;Exercise 22;414
11.14.23;Exercise 23;415
11.14.24;Exercise 24;415
11.14.25;Exercise 25;416
12;Chapter 7: Linear Algebra;417
12.1;Introduction to Linear Algebra;417
12.2;Matrix Properties and Operators;419
12.2.1;Simulink Blocks for Matrix Determinant, Diagonal Extraction, and Transpose;420
12.2.2;Matrix Inverse or Inverse Matrix;424
12.2.3;Simulink Blocks for Inverse Matrix;425
12.2.3.1;Example 1: Solving a System of Linear Equations;428
12.2.3.2;Simulink Modeling;434
12.2.3.3;Example 2: Embedding a MATLAB Function Block to Compute the Determinant and Solve Linear Equations;437
12.2.3.4;Example 3: Accuracy of Solver Functions of Linear Equations;439
12.2.3.5;Example 4: Efficiency of Solver Functions of Linear Equations;442
12.2.3.6;Example 5: Solving Linear Equations ([A]{x} = [b]) by Changing Values of [b];445
12.3;Matrix Operations;448
12.3.1;Example: Performing Matrix Operations;451
12.4;Standard Matrix Generators;460
12.5;Vector Spaces;465
12.5.1;Polynomials Represented by Vectors;467
12.5.2;Simulink Model Based Solution of Polynomials;469
12.6;Eigen-Values and Eigen-Vectors;471
12.7;Matrix Decomposition;474
12.7.1;QR Decomposition;474
12.7.1.1;Example: Computing QR Decomposition of a 5-by-5 Matrix;475
12.7.2;LU Decomposition;477
12.7.2.1;Example: Computing LU Composition of a 3-by-3 Pascal Matrix;478
12.7.3;Cholesky Decomposition;480
12.7.4;Schur Decomposition;484
12.7.5;Singular Value Decomposition (SVD);487
12.8;Logic Operators, Indexes, and Conversions;489
12.8.1;Logical Indexing;490
12.8.2;Example: Logical Indexing to locate and Substitute Elements of A Matrix;493
12.8.3;Conversions;495
12.8.3.1;Example: Creating Character Strings with char();498
12.9;Summary;500
12.10;References;501
12.11;Exercises for Self-Testing;502
12.11.1;Exercise 1;502
12.11.2;Exercise 2;503
12.11.3;Exercise 3;503
12.11.4;Exercise 4;504
12.11.5;Exercise 5;504
12.11.6;Exercise 6;505
12.11.7;Exercise 7;505
12.11.8;Exercise 8;505
12.11.9;Exercise 9;506
12.11.10;Exercise 10;506
12.11.11;Exercise 11;506
12.11.12;Exercise 12;507
12.11.13;Exercise 13;507
12.11.14;Exercise 14;507
12.11.15;Exercise 15;507
12.11.16;Exercise 16;508
12.11.17;Exercise 17;508
12.11.18;Exercise 18;508
12.11.19;Exercise 19;508
12.11.20;Exercise 20;509
12.11.21;Exercise 21;509
12.11.22;Exercise 22;509
12.11.23;Exercise 23;509
12.11.24;Exercise 24;509
12.11.25;Exercise 25;510
13;Chapter 8: Ordinary Differential Equations;511
13.1;Classifying ODEs;512
13.1.1;Example 1: Unconstrained Growth of Biological Organisms;513
13.1.2;Example 2: Radioactive Decay;513
13.1.3;Example 3: Newton’s Second Law;514
13.2;Analytical Methods;515
13.2.1;DSOLVE;516
13.2.2;Example 1: Using dsolve;516
13.2.3;Example 2: Plotting from dsolve;516
13.2.4;Example 3: Adding an Unspecified Parameter;518
13.3;Second-Order ODEs and a System of ODEs;519
13.3.1;Example 1: dsolve with a Second-Order ODE;519
13.3.2;Example 2: System ODEs;520
13.3.3;Example 3: Unsolvable Solutions Using dsolve;521
13.3.4;Example 4: Computing an Analytical Solution;522
13.3.5;Example 5: An Interesting ODE;522
13.3.6;Example 6: Responding to No Analytical Solution;523
13.4;Laplace Transforms;524
13.4.1;Example 1: First Laplace Transform;525
13.4.2;LAPLACE/ILAPLACE;526
13.4.2.1;Example 2: Using LAPLACE;527
13.4.2.2;Example 3: A Final LAPLACE;527
13.4.2.3;Example 4: Comparing LAPLACE/ILAPLACE with DSOLVE;528
13.4.2.4;Example 5: Convergent Answers;530
13.4.2.5;Example 6: No Analytical Solution;532
13.4.2.6;Example 7: Demonstrating Efficiency and Effortlessness;533
13.5;References;536
14;Index;537




