Engineering Computer Applications-Lec1
Engineering Computer Applications-Lec1
Computer
Applications
MATLAB
Introduction to MATLB
MATLAB Variables
Matrices Operations
Course Polynomials
Complex Numbers
Agenda Plotting
Programming
User-defined Functions
Simulink
Introduction to MATLAB
• MATLAB came from Matrix Laboratory or Mathematics Laboratory
• All variables are treated as matrices.
• MATLAB plays a crucial role in engineering and computer applications due to its powerful
computational abilities, extensive toolboxes, and versatility for solving complex mathematical,
scientific, and engineering problems.
• Mathematical Modeling and Simulation
• Data Analysis and Visualization
• Control Systems Design
• Signal and Image Processing
• Optimization and Numerical Analysis
• Embedded Systems Development
• Communication Systems Design
• Machine Learning and AI
• Automation and Robotics
• MATLAB is also a high-level programming language, and the platform offers great flexibility to use
with other programming languages, e.g., Python, C/C++, Java, etc.
Introduction to Matlab: Matlab interface
Current Directory
Current Folder
Workspace
Command Window
Command History
m file comment
Introduction to Matlab: Matlab interface
Introduction to Matlab
• Getting help
➢Use help to request info on a specific function
➢ displays help in the command window
>> help sqrt
• Entering a vector
>> A = [1 2 3];
• Entering a matrix:
>> B=[1 2 3; 4 5 6];
• Matrix indices begin from 1 (not 0!!!)
• Entering a string:
>> C = ‘Hello World!';
MATLAB Built-in Functions
• Elementary matrices functions
➢ zeros(m,n)
➢ ones(m,n)
➢ eye(m,n)
➢ diag(A)
➢ rand(m,n)
➢ randn(m,n)
➢ logspace(a,b,n)
➢ linspace (a,b,n)
➢ ….
Matrices Operations
• Accessing Matrix Elements
• A(2,3)
• A(:,2)
• A(end,:)
• A([1,2],[1,3])
• A(1:2,3:end)
• Matrix Operations
• + addition
• - subtraction
• * multiplication
• ^ power
• And, or, not
M_FIle
• Click to create
• a new M-File
Practical exam
20 mark-------→ Midterm quiz
Online quiz
20 mark-------→ Practical
Project, assignment,…..
20 mark------→ lecture
Thanks