Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
89 views

EXPERIMENT # Introduction To MATLAB Title: Electric Circuit Theory Laboratory (PC - EE 391)

This document provides an introduction and tutorial on MATLAB. It discusses that MATLAB is a numerical computing environment and programming language. It can perform matrix operations and graphing. The document then provides examples of basic MATLAB commands like creating matrices, performing operations on matrices like inverse, transpose, and element-wise operations. It also demonstrates how to add and manipulate rows and columns in matrices.

Uploaded by

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

EXPERIMENT # Introduction To MATLAB Title: Electric Circuit Theory Laboratory (PC - EE 391)

This document provides an introduction and tutorial on MATLAB. It discusses that MATLAB is a numerical computing environment and programming language. It can perform matrix operations and graphing. The document then provides examples of basic MATLAB commands like creating matrices, performing operations on matrices like inverse, transpose, and element-wise operations. It also demonstrates how to add and manipulate rows and columns in matrices.

Uploaded by

Pinaki Biswas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Techno Main Saltlake

Department of Electrical Engineering

EXPERIMENT # Introduction to MATLAB

TITLE
Familiarization with and Tutorial on MATLAB Package Software.

OBJECTIVE
1. To know what it is.
2. How to invoke and quit the system.
3. Basics of programming.
4. Different Commands.

FAMILARISATION
Matlab is a commercial package and stands for "Matrix Laboratory" which operates as an
interactive programming environment.
Matlab is a tool for doing numerical computations with matrices and vectors. It can also display
information graphically. The best way to learn what Matlab can do is to work through some
examples at the computer.
To start MATLAB on Windows double click MATLAB shortcut icon on the desk-top or click
STARTclick Program click Matlab I When run MATLAB is run under the window system,
whether started from the menu or a system prompt, a small MATLAB logo window will pop up
while the program is loading and disappear when MATLAB is ready to use.
Matlab has many types of matrices which are built into the system, i.e., rand, zreos, ones, eye
etc.
MATLAB is also a programming language. By creating a file with the extension .m programs
can be easily written and run. If to create a program file myfile.m in the MATLAB language, then
to make the command myfile from MATLAB and it will run like any other MATLAB function.
Some MATLAB function descriptions
zeros - Zeros matrix.
ones - Ones matrix.
eye - Identity matrix.
rand - Uniformly distributed random numbers.
Ans - Most recent answer.
pi - 3.1415926535897....
i, j - Imaginary unit.
inf - Infinity.
sin - Sine.

Electric Circuit Theory Laboratory (PC – EE 391)


Techno Main Saltlake
Department of Electrical Engineering

sinh - Hyperbolic sine.


asin - Inverse sine.
asinh - Inverse hyperbolic sine.
cos - Cosine.
cosh - Hyperbolic cosine.
acos - Inverse cosine.
acosh - Inverse hyperbolic cosine.
tan - Tangent.
tanh - Hyperbolic tangent.
atan - Inverse tangent.
atanh - Inverse hyperbolic tangent.
exp - Exponential.
log - Natural logarithm.
log10 - Common logarithm.
sqrt - Square root.
abs - Absolute value.
angle - Phase angle.
conj - Complex conjugate.
imag - Complex imaginary part.
real - Complex real part.
norm - Matrix or vector norm.
rank - Number of linearly independent rows or columns.
det - Determinant.
trace - Sum of diagonal elements.
plot - Linear plot.
stem - Discrete plot.
loglog - Log-log scale plot.
semilogx - Semi-log scale plot.
semilogy - Semi-log scale plot.
title - Graph title.
xlabel - X-axis label.
ylabel - Y-axis label.
text - Text annotation.
grid - Grid lines.

STUDY ON COMPUTATION OF MATRICES


>> a= [1 2 3; 4 5 6; 6 8 9]
a=
1 2 3
4 5 6
6 8 9

>> inv (a) [Inverse of Matrices]


ans =
-1.0000 2.0000 -1.0000
0 -3.0000 2.0000
0.6667 1.3333 -1.0000

Electric Circuit Theory Laboratory (PC – EE 391)


Techno Main Saltlake
Department of Electrical Engineering

>> a' [transpose]


ans =
1 4 6
2 5 8
3 6 9

>> rank (a)


ans =
3

>> trace (a)


ans =
15

>> det (a) [Value of Determinant]


ans =
3

>> max (a)


ans =
6 8 9

>> min(a)
ans =
1 2 3

>> mean (a)


ans =
3.6667 5.0000 6.0000

>> b=[2 6 8;2 5 9;1 7 4]


b=
2 6 8
2 5 9
1 7 4

>> b=[r; b] [Adding rows (add before)]


b=
8 9 7
2 6 8
2 5 9
1 7 4

>> b=[2 6 8;2 5 9;1 7 4]


b=
2 6 8
2 5 9
1 7 4

Electric Circuit Theory Laboratory (PC – EE 391)


Techno Main Saltlake
Department of Electrical Engineering

>> r= [8; 9; 7]; [Adding columns (add before)]

>> c= [b r]
c=
2 6 8 8
2 5 9 9
1 7 4 7

>> a*b [Multiplication]


ans =
9 37 38
24 91 101
37 139 156

>> a+b [Addition]


ans =
3 8 11
6 10 15
7 15 13

>> a-b [substraction]


ans =
-1 -4 -5
2 0 -3
5 1 5

>> a.*b [element wise multiplication]


ans =
2 12 24
8 25 54
6 56 36

Electric Circuit Theory Laboratory (PC – EE 391)

You might also like