EXPERIMENT - 2
AIM
To Demonstrate basic MATLAB operations .
THEORY
MATLAB is an abbreviation for "matrix laboratory". While other programming languages mostly work with numbers one at a time, MATLAB is designed to operate primarily on whole matrices and arrays.
MATLAB allows you to process vectors and complex numbers too.
MATLAB COMMANDS USED
* abs(x) : Magnitude of a complex number
* angle(x) : Phase of a complex number
* stem(V) : Plots a Sequence
MATLAB CODE
%Some Basic MATLAB commands
clc ;
clear;
V = [1 2 4 6 2 4];
A=4+3*i;
display(['The Magnitude of A ',num2str(A),
' is ',num2str(abs(A)),' and the phase
is ',num2str(angle(A)*180/pi)])
display(['The vector V is ',num2str(V)]);
stem(V,'black','filled');
xlabel('n')
title({'The plot of vector V ',num2str(V)})
ylabel('Magnitude')
RESULT
The basic MATLAB operations have been demonstrated.