Beruflich Dokumente
Kultur Dokumente
MLBE912V1
MATLAB Fundamentals
TOC-1
Table of Contents
Objetivo
El objetivo general del curso es dotar a los asistentes de la
habilidad bsica del uso de la herramienta MATLAB, como un
software de computo tcnico. Al final el curso, los asistentes
podrn realizar las 3 tareas bsicas del computo tcnico:
Obtener datos de diversos medios; Procesarlos matemticamente
y visualizarlos; Compartir los resultados a travs de aplicaciones
y reportes.
Principales Beneficios
MATLAB es un software lder en el computo cientfico y
tcnico, pensado como una plataforma de computo al tiempo
que es un poderoso lenguaje de programacin de alto nivel. Su
creacin ha sido pensada en automatizar clculos y realizar
tareas matemticas complejas de manera interactiva,
estructurada y programtica. por lo que su conocimiento bsico
deriva en una reduccin de tiempo en la realizacin de tareas de
anlisis y visualizacin de datos, desarrollo de aplicaciones
simples y publicacin de resultados.
MATLAB Fundamentals
TOC-2
Table of Contents
NOSOTROS
Somos una empresa mexicana con ms de 15 aos de experiencia. Fundada
en 1989 para satisfacer la creciente demanda del mercado especializado de
Software Cientfico y Tcnico para la Industria, las Ciencias, los Servicios y la
Educacin de Mxico y Latinoamrica.
Ofrecemos Cursos de MINITAB, MATLAB, MAPLE, entre otros
productos. Nuestra consultora consiste en el desarrollo de aplicaciones
cientficas y tcnicas, integracin de sistemas en las reas de control,
electrnica, mecnica, finanzas, instrumentacin, medicin, adquisicin/
captura de datos en lnea y anlisis en tiempo real para control de procesos.
Visitenos www.multion.com.mx
Mayores informes (Cursos)
Joel Cervantes
MultiON Consulting, SA de CV
Insurgentes Sur 1236-301 Mxico, DF, 03200 MEXICO
Tel.: (55) 5559-4050 ext. 119
Fax: (55) 5559-4048 Country Code: 52
Email: cursos@multion.com.mx
MATLAB Fundamentals
TOC-3
Table of Contents
This Training Course Notebook, along with other Training Course Examples
and Exercises, shall at all times remain the intellectual property of The
MathWorks, Inc. The MathWorks, Inc. reserves all rights in these materials.
No part of these materials may be photocopied, reproduced in any form, or
distributed without prior written consent from The MathWorks, Inc.
MATLAB Fundamentals
TOC-4
Table of Contents
Table of Contents
1.
Introduction
2.
11.
3.
4.
5.
6.
7.
16. Conclusion
8.
Appendices
9.
MATLAB Fundamentals
TOC-5
Table of Contents
Table of Contents
1. Introduction
MathWorks at a Glance........................................................................................................................................................................................................ 1-2
Worldwide Offices................................................................................................................................................................................................................... 1-3
MathWorks Product Overview...........................................................................................................................................................................................
1-4
1-6
MATLAB?...................................................................................................................................................................................
1-7
1-8
Course Outline.........................................................................................................................................................................................................................
1-9
MATLAB Fundamentals
TOC-6
Table of Contents
Table of Contents
2. Working with the MATLAB User Interface
Outline....................................................................................................................................................................................................................................... 2-2
Chapter 2 Learning Outcomes..............................................................................................................................................................................................
2-3
2-4
2-7
2-8
2-9
2-11
2-13
Multiple Plots...........................................................................................................................................................................................................................
2-14
2-15
2-18
Shortcuts...................................................................................................................................................................................................................................
2-19
Summary.................................................................................................................................................................................................................................... 2-20
Chapter 2 Test Your Knowledge........................................................................................................................................................................................... 2-21
2012 by MathWorks, Inc.
MATLAB Fundamentals
TOC-7
Table of Contents
Table of Contents
3. Variables and Expressions
Outline....................................................................................................................................................................................................................................... 3-2
Chapter 3 Learning Outcomes..............................................................................................................................................................................................
3-3
MATLAB Commands..........................................................................................................................................................................................................
3-4
3-5
Assignment...............................................................................................................................................................................................................................
3-6
3-8
3-9
3-11
3-12
3-14
MATLAB Fundamentals
TOC-8
Table of Contents
Table of Contents
4. Analysis and Visualization with Vectors
Outline....................................................................................................................................................................................................................................... 4-2
Chapter 4 Learning Outcomes..............................................................................................................................................................................................
4-3
4-5
Mathematical Operations.......................................................................................................................................................................................................
4-6
4-8
Annotating Plots......................................................................................................................................................................................................................
4-9
MATLAB Fundamentals
TOC-9
Table of Contents
Table of Contents
5. Analysis and Visualization with Matrices
Outline....................................................................................................................................................................................................................................... 5-2
Chapter 5 Learning Outcomes..............................................................................................................................................................................................
5-3
Determining Size.....................................................................................................................................................................................................................
5-4
5-6
Mathematical Operations.......................................................................................................................................................................................................
5-7
5-10
Reshaping..................................................................................................................................................................................................................................
5-11
Linear Indexing........................................................................................................................................................................................................................
5-12
MATLAB Fundamentals
TOC-10
Table of Contents
Table of Contents
6. Automating Commands with Scripts
Outline....................................................................................................................................................................................................................................... 6-2
Chapter 6 Learning Outcomes..............................................................................................................................................................................................
6-3
6-4
6-9
MATLAB Fundamentals
TOC-11
Table of Contents
Table of Contents
7. Working with Data Files
Outline....................................................................................................................................................................................................................................... 7-2
Chapter 7 Learning Outcomes..............................................................................................................................................................................................
7-3
7-5
7-6
7-8
7-9
Summary.................................................................................................................................................................................................................................... 7-10
Chapter 7 Test Your Knowledge........................................................................................................................................................................................... 7-11
MATLAB Fundamentals
TOC-12
Table of Contents
Table of Contents
8. Working with Text and Dates
Outline....................................................................................................................................................................................................................................... 8-2
Chapter 8 Learning Outcomes..............................................................................................................................................................................................
8-3
8-9
MATLAB Fundamentals
TOC-13
Table of Contents
Table of Contents
9. Multiple Vector Plots
Outline....................................................................................................................................................................................................................................... 9-2
Chapter 9 Learning Outcomes..............................................................................................................................................................................................
9-3
9-5
9-7
Plotting Functions...................................................................................................................................................................................................................
9-8
9-12
Summary.................................................................................................................................................................................................................................... 9-13
Chapter 9 Test Your Knowledge........................................................................................................................................................................................... 9-15
MATLAB Fundamentals
TOC-14
Table of Contents
Table of Contents
10. Logic and Flow Control
Outline....................................................................................................................................................................................................................................... 10-2
Chapter 10 Learning Outcomes............................................................................................................................................................................................
10-3
10-6
10-8
User Interaction.......................................................................................................................................................................................................................
10-9
Flow Control............................................................................................................................................................................................................................
10-10
For-Loops.................................................................................................................................................................................................................................
10-11
While-Loops.............................................................................................................................................................................................................................
10-12
Summary.................................................................................................................................................................................................................................... 10-13
Chapter 10 Test Your Knowledge......................................................................................................................................................................................... 10-15
MATLAB Fundamentals
TOC-15
Table of Contents
Table of Contents
11. Matrix and Image Visualization
Outline....................................................................................................................................................................................................................................... 11-2
Chapter 11 Learning Outcomes............................................................................................................................................................................................
11-3
11-7
11-9
Colormaps................................................................................................................................................................................................................................. 11-10
True Color Images................................................................................................................................................................................................................... 11-11
Summary.................................................................................................................................................................................................................................... 11-12
Chapter 11 Test Your Knowledge......................................................................................................................................................................................... 11-13
MATLAB Fundamentals
TOC-16
Table of Contents
Table of Contents
12. Data Analysis
Outline....................................................................................................................................................................................................................................... 12-2
Chapter 12 Learning Outcomes............................................................................................................................................................................................
12-3
12-4
12-5
12-7
12-10
Frequency Analysis..................................................................................................................................................................................................................
12-11
FFTs...........................................................................................................................................................................................................................................
12-12
Matrix Equations.....................................................................................................................................................................................................................
12-13
12-14
12-15
Summary.................................................................................................................................................................................................................................... 12-16
Chapter 12 Test Your Knowledge......................................................................................................................................................................................... 12-17
MATLAB Fundamentals
TOC-17
Table of Contents
Table of Contents
13. Writing Functions
Outline....................................................................................................................................................................................................................................... 13-2
Chapter 13 Learning Outcomes............................................................................................................................................................................................
13-3
Increasing Automation...........................................................................................................................................................................................................
13-4
13-10
Summary.................................................................................................................................................................................................................................... 13-11
Chapter 13 Test Your Knowledge......................................................................................................................................................................................... 13-13
MATLAB Fundamentals
TOC-18
Table of Contents
Table of Contents
14. Troubleshooting Code and Improving Performance
Outline....................................................................................................................................................................................................................................... 14-2
Chapter 14 Learning Outcomes............................................................................................................................................................................................
14-3
Debugging................................................................................................................................................................................................................................. 14-4
Analyzing Code in the Editor................................................................................................................................................................................................
14-5
14-7
Ending Debugging..................................................................................................................................................................................................................
14-8
MATLAB Fundamentals
TOC-19
Table of Contents
Table of Contents
15. Data Types
Outline....................................................................................................................................................................................................................................... 15-2
Chapter 15 Learning Outcomes............................................................................................................................................................................................
15-3
15-7
Structure Arrays.......................................................................................................................................................................................................................
15-8
15-9
15-11
Summary.................................................................................................................................................................................................................................... 15-12
Chapter 15 Test Your Knowledge......................................................................................................................................................................................... 15-13
MATLAB Fundamentals
TOC-20
Table of Contents
Table of Contents
Appendices
MATLAB Reference.............................................................................................................................................................................................................
Exercises.................................................................................................................................................................................................................................... B
MATLAB Fundamentals
TOC-21
Table of Contents
MLPR912V2
Table of Contents
Objetivo
El objetivo general del curso es dotar a los asistentes de la
habilidad para la programacin en MATLAB, como un software
de computo tcnico. Al final el curso, los asistentes podrn
programar y realizar aplicaciones diversas que le servirn para
el anlisis y visualizacin de su informacin; as como para
desarrollar programas ms robustos y eficientes.
Principales Beneficios
MATLAB es un software lder en el computo cientfico y
tcnico, pensado como una plataforma de computo al tiempo
que es un poderoso lenguaje de programacin de alto nivel. Su
creacin ha sido pensada en automatizar clculos y realizar
tareas matemticas complejas de manera interactiva,
estructurada y programtica. por lo que su conocimiento bsico
deriva en una reduccin de tiempo en la realizacin de tareas de
anlisis y visualizacin de datos, desarrollo de aplicaciones
simples y publicacin de resultados.
Table of Contents
NOSOTROS
Somos una empresa mexicana con ms de 15 aos de experiencia. Fundada
en 1989 para satisfacer la creciente demanda del mercado especializado de
Software Cientfico y Tcnico para la Industria, las Ciencias, los Servicios y la
Educacin de Mxico y Latinoamrica.
Ofrecemos Cursos de MINITAB, MATLAB, MAPLE, entre otros
productos. Nuestra consultora consiste en el desarrollo de aplicaciones
cientficas y tcnicas, integracin de sistemas en las reas de control,
electrnica, mecnica, finanzas, instrumentacin, medicin, adquisicin/
captura de datos en lnea y anlisis en tiempo real para control de procesos.
Visitenos www.multion.com.mx
Mayores informes (Cursos)
Joel Cervantes
MultiON Consulting, SA de CV
Insurgentes Sur 1236-301 Mxico, DF, 03200 MEXICO
Tel.: (55) 5559-4050 ext. 119
Fax: (55) 5559-4048 Country Code: 52
Email: cursos@multion.com.mx
Table of Contents
This Training Course Notebook, along with other Training Course Examples
and Exercises, shall at all times remain the intellectual property of The
MathWorks, Inc. The MathWorks, Inc. reserves all rights in these materials.
No part of these materials may be photocopied, reproduced in any form, or
distributed without prior written consent from The MathWorks, Inc.
Table of Contents
Table of Contents
1.
Introduction
2.
3.
Development Tools
4.
Structuring Code
5.
Structuring Data
6.
7.
8.
Conclusion
Appendices
Table of Contents
Table of Contents
1. Introduction
MathWorks at a Glance........................................................................................................................................................................................................ 1-2
Worldwide Offices................................................................................................................................................................................................................... 1-3
MathWorks Product Overview...........................................................................................................................................................................................
1-4
1-6
1-7
Course Outline.........................................................................................................................................................................................................................
1-8
Table of Contents
Table of Contents
2. Creating Robust Applications
Outline....................................................................................................................................................................................................................................... 2-2
Chapter 2 Learning Outcomes..............................................................................................................................................................................................
2-3
2-6
2-7
2-10
Table of Contents
Table of Contents
3. Development Tools
Outline....................................................................................................................................................................................................................................... 3-2
Chapter 3 Learning Outcomes..............................................................................................................................................................................................
3-3
3-5
3-6
3-8
Examining Values....................................................................................................................................................................................................................
3-9
3-12
Summary.................................................................................................................................................................................................................................... 3-13
Chapter 3 Test Your Knowledge........................................................................................................................................................................................... 3-14
Table of Contents
Table of Contents
4. Structuring Code
Outline....................................................................................................................................................................................................................................... 4-2
Chapter 4 Learning Outcomes..............................................................................................................................................................................................
4-3
Private Functions.....................................................................................................................................................................................................................
4-4
Subfunctions............................................................................................................................................................................................................................. 4-5
Nested Functions..................................................................................................................................................................................................................... 4-6
Function Handles..................................................................................................................................................................................................................... 4-7
Anonymous Functions............................................................................................................................................................................................................ 4-8
Changing Interface with Anonymous Functions............................................................................................................................................................... 4-9
Precedence Rules.....................................................................................................................................................................................................................
4-10
4-11
Summary.................................................................................................................................................................................................................................... 4-12
Chapter 4 Test Your Knowledge........................................................................................................................................................................................... 4-13
Table of Contents
Table of Contents
5. Structuring Data
Outline....................................................................................................................................................................................................................................... 5-2
Chapter 5 Learning Outcomes..............................................................................................................................................................................................
5-3
5-4
5-5
5-11
Table of Contents
Table of Contents
6. Efficient Data Management
Outline....................................................................................................................................................................................................................................... 6-2
Chapter 6 Learning Outcomes..............................................................................................................................................................................................
6-3
Preallocation.............................................................................................................................................................................................................................
6-4
6-5
Vectorization............................................................................................................................................................................................................................. 6-6
Applying Scalar Functions to Arrays....................................................................................................................................................................................
6-7
6-8
6-10
Table of Contents
Table of Contents
7. Classes and Objects
Outline....................................................................................................................................................................................................................................... 7-2
Chapter 7 Learning Outcomes..............................................................................................................................................................................................
7-3
7-4
7-6
7-7
Properties..................................................................................................................................................................................................................................
7-8
Methods..................................................................................................................................................................................................................................... 7-9
Property Attributes.................................................................................................................................................................................................................. 7-10
Creating a Table Object..........................................................................................................................................................................................................
7-11
7-12
7-14
7-16
Code Reuse...............................................................................................................................................................................................................................
7-17
Summary.................................................................................................................................................................................................................................... 7-18
Chapter 7 Test Your Knowledge........................................................................................................................................................................................... 7-19
Table of Contents
Table of Contents
Appendices
Exercises.................................................................................................................................................................................................................................... A