0% found this document useful (0 votes)
332 views3 pages

Measurement and Instrumentation Laboratory

Uploaded by

Salman Ajmal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
332 views3 pages

Measurement and Instrumentation Laboratory

Uploaded by

Salman Ajmal
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Measurement and Instrumentation MATLAB Lab Manual

Measurement and Instrumentation Laboratory


MATLAB Lab Manual 1.

Introduction to MATLAB

Matlab, which stands for Matrix Laboratory, is a mathematical software used


extensively in academia and Industry. It is an interactive program for numerical
computation and data visualization which alongwith its programming capabilities
opens wide applications in the field of Engineering.

In the field of Measurement and Instrumentation, Matlab provides almost all


measuring tools in its Simulink toolbox which we shall see in upcoming manuals.

The purpose of this manual is to introduce you with some basic operations of
Matlab that we encounter in our everyday life.

The Matlab prompt “>>” indicates where the commands are entered by the user.
The command is processed by the Matlab and the corresponding output is
displayed on the next line.

Remember: Matlab is CASE SENSITIVE i-e, a+B doesn’t mean a+b::

Starting with very basic commands as that of a calculator

Please execute the following commands and write the output.

>> a=3

>> b=4

>> x=a+b

The other basic arithmetic operators are::

Copyright ©; Hasan Erteza Gelani, Lecturer UET Fsd


This material is exclusively for the use of students studying in the Electrical Engg Dept, UET Fsd
Page 1
Measurement and Instrumentation MATLAB Lab Manual

‘-‘ subtraction

‘*’ multiplication

‘/’ division

‘^’ power

‘( )’ brackets

Please execute the following commands, and write the output. Also try to solve
these on your own using simple algebraic techniques and check your answer with
the Matlab output.

- 2+3/4*5
- ((5*3)/4)+3*7-2
- 7/3+5*3-2^3

Matlab actually deals with MATRICES or VECTORS. Let us start with a basic
row vector having values in a single row as 1 2 3 4 5 and we want to name it a
variable ‘x’

Please execute the following commands and write the output::

>> x=[1 2 3 4 5]

>>x=[1,2,3,4,5]

Now use ‘;’ in place of ‘,’ in the above command. What happened?

__________________________________________________________________
__________________________________________________________________

Copyright ©; Hasan Erteza Gelani, Lecturer UET Fsd


This material is exclusively for the use of students studying in the Electrical Engg Dept, UET Fsd
Page 2
Measurement and Instrumentation MATLAB Lab Manual

Now make your own matrix having 3 rows with elements 1 2 3 in 1st row, 2 4 6 in
2nd row and 3 5 7 in the 3rd row. Your matrix is ‘x’

Try to find the size and transpose of the matrix using suitable commands. Use help
command to find the solution e-g

>> help size

Please write the commands you used and the output::

Now execute the following commands and state what happened::

>>y=[0:6]

>>y(1,1)

>>y(1:1)

>>y[1:2:6]

>>y(2,2)

Bonus Assignment: Make a 3 by 3 matrix and try to find out its product with
another 3 by 3 matrix, then find the determinant and inverse of the product
matrix.

Copyright ©; Hasan Erteza Gelani, Lecturer UET Fsd


This material is exclusively for the use of students studying in the Electrical Engg Dept, UET Fsd
Page 3

You might also like