0% found this document useful (0 votes)
2 views

lecture-2-matlab

This document is a tutorial on Matlab covering both basic and advanced topics, including environment setup, syntax, data types, operators, and various mathematical functions. It also includes sections on plotting, graphics, and Simulink, along with practical examples and homework assignments. References to additional resources for further learning are provided at the end.

Uploaded by

gamingkovan
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

lecture-2-matlab

This document is a tutorial on Matlab covering both basic and advanced topics, including environment setup, syntax, data types, operators, and various mathematical functions. It also includes sections on plotting, graphics, and Simulink, along with practical examples and homework assignments. References to additional resources for further learning are provided at the end.

Uploaded by

gamingkovan
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 30

Lecturer # 2

IT

[Matlab-Tutorial (2)]

Dr. Shilan mohammad


1
Topics
 Matlab Tutorial  Matlab Advanced
 Home
 Overview  Plotting
 Environment Setup  Graphics
 Syntax  Algebra
 Variables  Calculus
 Commands  Differential
 M-Files  Integration
 Data Types
 Polynomials
 Operators
 Decisions
 Transforms
 Loops
 GNU Octave
 Vectors  Simulink
 Matrix
 Arrays
 Colon Notation
 Numbers
 Strings
 Functions
 Data Import
 Data Output 2
Topics
 Matlab Tutorial  Matlab Advanced
 Home
 Overview  Plotting
 Environment Setup  Graphics
 Syntax  Algebra
 Variables  Calculus
 Commands  Differential
 M-Files  Integration
 Data Types
 Polynomials
 Operators
 Decisions
 Transforms
 Loops
 GNU Octave
 Vectors  Simulink
 Matrix
 Arrays
 Colon Notation
 Numbers
Reference:
 Strings
https://www.tutorialspoint.com/matlab/index.htm
 Functions https://www.tutorialspoint.com/matlab/matlab_quick_guide.
 Data Import htm 16
 Data Output 33
Matlab Tutorial: m-files

4
Matlab Tutorial: m-files

5
Matlab Tutorial: m-files

6
Matlab Tutorial: m-files

7
Matlab Tutorial: m-files

8
Matlab Tutorial: Data Types

9
Matlab Tutorial: Data Types

10
Numerical
types
Double: 34 byte (They can also
include negative numbers and
decimals.)
Single: 17 byte (They can also
include negative numbers and
decimals.)

11
12
Matlab Tutorial: Operators

13
(arithmetic operators)

A B C D

14
Example:

15
(arithmetic operators)
F

16
Example:

17
18
19
20
Bitwise Operators

21
Matlab Tutorial: Decision Making

22
Matlab Tutorial: Loops

23
Matlab Tutorial: Vectors

24
Matlab Tutorial: Matrix

25
Matlab Tutorial: Arrays

26
Live script window(.mlX
file)
1

1- go to home
2- go to new live script
(This file is created with the extension .mlx)
(This file is very user-friendly.( 27
Plot curves in live script
1

1- for creating sections in this window write


bellow code
%% section1:
X=0:0.1:2*pi;
28
2- %% section2:
Example:
create a live script in which
plot bellow equation and
insert a numerical slider for
change z:
z=4
x=0:0.1:z*pi;
y=cos(x)

29
Homework

A- Create a function with name “health index” in editor window in


which get weight and Hight then calculate this formula and print
output

30

You might also like