You are on page 1of 39

EEE 241

MATLAB FOR ENGINEERS

Lecture slides are modified by Asst. Prof. Dr. M. H. DOĞRU,


based on original slides by Prof.Dr. İbrahim H. GÜZELBEY,
Prof.Dr. İrfan KAYMAZ and Prof.Dr. Bülent ÇAKMAK

1
MATLAB FOR ENGINEERS
EEE 241
Credit Strucutre: (3-0)3
Course Description: Matlab® as an interactive symbolic calculator, graphics, algebra and calculus, solving equations,
solving differential equations and PDE, lists, matrices, transformation rules, functional operations and pure functions,
introduction to programming,
Course Objectives:
The main objective is to learn how to write MATLAB programs for engineering applications that include calculations and
graphing.
There is a strong emphasis on the documenting of programs. A detailed understanding of the logic and language of
the Matlab®
will be achived.
Textbook(s):
Holly Moore “MATLAB for Engineer”, Pearson Education, Second edition, 2009
References:
1. Brian R Hunt, et al, “A Guide to Matlab”, Cambridge Univ. Press, 2001
2. Sikander M Mirza, “Introduction to Matlab”, PIES, 2001
3. David F. Griths “Introduction to Matlab”, The University Dundee, 2001
4. Patrick Marchand and O . Thomas Holland “Graphics and GUIs With Matlab”, Chapman & Hall/CRC , 2003
5. İrfan KAYMAZ and Bülent ÇAKMAK Course Notes

Syllabus:
0. Introduction to Programming
PART I.
1. Introduction to Matlab
2. Algoritm and Flow Charts
3. Mathematical Operations
4. Solving Linear Equations-Differentiation-Integration

PART II.
6. Control Structure
7. Repetitive Structure
8. Functions
9. File Processing
10. Graphics
Homework, Quizzes and Exams:
Exams: Midterm 1: 30% Midterm 2 : %30 Final: 40%

Asst.Prof.Dr. Mehmet Hanifi DOĞRU


mhdogru@gantep.edu.tr 2
OUTLINE OF COURSE
1. WEEK (27 September) Introduction to Programming,
2. WEEK ( 4 october) Algoritm and Flow Chart,
3. WEEK ( 11 October) Introduction to MATLAB, interface , Data types,
Constatns, Variables, Operators, Aritmetic
Calculations,

4. WEEK (18 October) Matrix operations ,

5. WEEK (25 October) Solving Linear Equations-


Differentiation-Integration ,

6. WEEK ( 1 november) Control Structures,


7. WEEK ( 8 November) Repetitive Structures,
8. WEEK (15 November) Repetitive Structures,
9. WEEK (22 November) I MIDTERM ?????????????
10. WEEK (29 december) Functions,
11. WEEK ( 6 December) Graphics,
12. WEEK (13 December) Graphics,
13. WEEK (20 December) II MIDTERM ?????????????
14. WEEK (27 December) File Processing.

?????? FINAL

3
REFERENCES
1. Brian R Hunt, et al, “A Guide to Matlab”, Cambridge Univ. Press, 2001
2. Sikander M Mirza, “Introduction to Matlab”, PIES, 2001
3. David F. Griths “Introduction to Matlab”, The University Dundee, 2001
4. Patrick Marchand and O . Thomas Holland “Graphics and GUIs With
Matlab”, Chapman & Hall/CRC , 2003
5. İrfan KAYMAZ and Bülent ÇAKMAK Course Notes

4
CHAPTER 0

INTRODUCTION

5
Matlab is one of a number of commercially
available, sophisticated mathematical computation
tools

Others include
Maple
Mathematica
MathCad

6
Matlab excels at

Numerical and Analytical calculations


Especially involving matrices
Graphics
Programming Language
Some Toolboxes . . .

7
Matlab was originally written in Fortran, then
later rewritten in C

8
PROGRAMMING LANGUAGE

Low-level Programming language High-level Programming language

Machine language

Assembly Visual Language Non-Visual language

Visualbasic
C

Delphi Fortran

Html Cobol

Java C++

Visual C Qbasic

MATLAB
Turbo pascal
PART I.
USAGE OF MATLAB SHELL

10
CHAPTER 1

INTRODUCTION TO MATLAB

11
What is MATLAB?

MATLAB (MATrix LABoratory) is an interactive system for matrix-based


computation designed for scientific and engineering use. It is applicable to
many forms of numeric computation and visualization. Besides dealing with
explicit matrices in linear algebra, it can handle differential equations,
polynomials, signal processing, and other applications. Results can be made
available both numerically and graphically.

12
Typical use of matlab :
 Mathematical operations and computations

Algorithm development

Modeling, simulation, and prototyping

Data analysis, exploration, and visualization

Scientific and engineering graphics

Application development, including Graphical User Interface (GUI) building

13
MATLAB features a family of application-specific solutions called toolboxes.
Toolboxes allow you to learn and apply specialized technology. Toolboxes are
comprehensive collections of MATLAB functions (M-files) that extend the
MATLAB environment to solve particular classes of problems. Areas in which
toolboxes are available include signal processing, control systems, neural
networks, fuzzy logic, wavelets, simulation, and many others.

14
THE MATLAB SYSTEM

The MATLAB system consists of five main parts:

1. The MATLAB language.

This is a high-level matrix/array language with control flow statements,


functions, data structures, input/output, and object-oriented programming
features. It allows both "programming in the small" to rapidly create quick and dirty
throw-away programs, and "programming in the large" to create complete large and
complex application programs.

15
2. The MATLAB working environment.

This is the set of tools and facilities that you work with as the MATLAB user or
programmer. It includes facilities for managing the variables in your workspace and
importing and exporting data. It also includes tools for developing, managing,
debugging, and profiling
M-files, MATLAB's applications.

3.Handle Graphics.

This is the MATLAB graphics system. It includes high-level commands for two-
dimensional and three-dimensional data visualization, image processing, animation,
and presentation graphics. It also includes low-level commands that allow you to fully
customize the appearance of graphics as well as to build complete GUI on your
MATLAB applications.
 

16
4.The MATLAB mathematical function library.

This is a vast collection of computational algorithms ranging from elementary


functions like sum, sine, cosine, and complex arithmetic, to more sophisticated
functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier
transforms (FFT).

5.The MATLAB Application Program Interface (API).

This is a library that allows you to write C and Fortran programs that interact with
MATLAB. It include facilities for calling routines from MATLAB (dynamic linking),
calling MATLAB as a computational engine, and for reading and writing MAT-files.

17
18
MATLAB TOOLBOXES

1. Matlab Product Family 2. Simulink Product Family 19


Math and Optimization

 Optimization Toolbox
Solve standard and large-scale optimization problems

20
Symbolic Math Toolbox
Perform mathematics using symbolic computation
and variable-precision arithmetic

21
 Genetic Algorithm and Direct Search Toolbox

Solve optimization problems using genetic


algorithms, simulated annealing, and direct search

22
Neural Network Toolbox
Design and simulate neural networks

23
 Fuzzy Logic Toolbox
Design and simulate fuzzy logic systems

24
Control System Design and Analysis

 Control System Toolbox


Design and analyze control systems

25
 Instrument Control Toolbox

Control and communicate with test and measurement


instruments

26
 Aerospace Toolbox
Aerospace Toolbox provides reference standards, environmental models, and
aerodynamic coefficient importing for performing advanced aerospace
analysis to develop and evaluate your designs. Options for visualizing vehicle
dynamics include a six-degrees-of-freedom MATLAB® animation object and
interfaces to FlightGear flight simulator and Simulink 3D Animation™
software. These options let you visualize flight data in a three-dimensional (3-
D) environment and reconstruct behavioral anomalies in flight-test results.

27
 Signal Processing Toolbox
Signal Processing Toolbox™ provides industry-standard algorithms for analog and
digital signal processing (DSP). You can use the toolbox to visualize signals in time and
frequency domains, compute FFTs for spectral analysis, design FIR (Digital filters with
finite-duration impulse response) and IIR (infinite-duration impulse response filters)
filters, and implement convolution, modulation, resampling, and other signal
processing techniques. Algorithms in the toolbox can be used as a basis for developing
custom algorithms for audio and speech processing, instrumentation, and baseband
wireless communications.

28
 Image Processing Toolbox

Perform image processing, analysis, and algorithm development

29
SIMULINK PRODUCT FAMILY

 Simulink
Simulation and Model-Based Design

30
Physical Modeling
 Simscape

Model and simulate multidomain physical


systems

31
SimMechanics

Model and simulate mechanical systems

32
 SimDriveline

Model and simulate mechanical driveline systems

33
 SimHydraulics

Model and simulate hydraulic systems

34
 SimElectronics
Model and simulate electronic and electromechanical
systems

35
Simulation Graphics

 Simulink 3D Animation
Animate and visualize Simulink models in three
dimensions

36
Control System Design and Analysis

 Simulink Control Design


Compute PID gains, linearize models, and design
control systems

37
 Aerospace Blockset

Model and simulate aircraft, spacecraft, and


propulsion systems

38
Simulink Design Optimization
Estimate and optimize Simulink model parameters

39

You might also like