with MATLAB
Dr. Zia R Tahir
Introduction to Matlab
Mechanical Engineering Department
, Mechanical Engineering Department, UET Lahore
Problem Solving in Engineering with MATLAB Dr Zia R Tahir
Introduction to Matlab
Outline
• The Matlab Environment
• Basic operations
• Variables
• Vectors
• Definition
• Basic operations
• 2D Plots
• Access information
• Matrices
• Definition
• Basic operations
• Access information
• Structures
2
, Mechanical Engineering Department, UET Lahore
Problem Solving in Engineering with MATLAB Dr Zia R Tahir
Introduction to Matlab
The Matlab environment
Help
Current Command window Workspace
folder
Command
Command prompt History
>>
EDU>
3
, Mechanical Engineering Department, UET Lahore
Problem Solving in Engineering with MATLAB Dr Zia R Tahir
Introduction to Matlab
Matlab as a numerical calculator
• Basic arithmetic operations
• + Addition
• - Subtraction
• * Multiplication
• / Division
• Hierarchy of arithmetic operations
1. Content of brackets is evaluated starting from the innermost bracket
2. Exponentials, from left to right (The symbol for exponentiation is ^)
3. Multiplications and divisions, from left to right
4. Additions and subtractions, from left to right
4