You are on page 1of 4

EXPERIMENT NO.

: 1

EXPERIMENT NAME: Familiarization With MATLAB, M-File


Coding.

OBJECTIVE:
1. To understand how to in M-File in MITLAB software.
2. To understand how observe the different parameters in
command window in MITLAB

THEORY:
MATLAB is a high-performance and fourth-generation language for
technical computing. The name MATLAB stands for MATrix
LABoratory. MATLAB was originally written to provide easy access to
matrix software developed by the LINPACK and EISPACK.
Typical uses for MATLAB
*Math and computations.
*Algorithm development.
*Modeling, simulation and prototyping.
*Data analysis, and visualization.
*Scientific and engineering graphics.
*Application development.

CODE WRITING:
Some codes and there outputs are shown below:
Program_1:Mathematical operation i.e
Addition,Subration,Multipication,Division.

clc Addition= 17
clear all Subtraction =5
a=11; OUTPUT Multipication =66
b=6; Division =1.8333
Addition=a+b
Subtraction=a-b
Multipication=a*b
Division=a/b

Program_2:Various type equation


solution.

clc e =97520
clear all
a=10; f = 28.2842
OUTPUT
b=5; g = 3.0016
c=2;
e=a^4+2*a^3*b^2+3*a^2*b^3+b*4
f=exp(-a)*sin(b)+20*sqrt(c)
g=log(a)+log10(b)

Program_3:2D graph of Sine and


Cos wave and their addition.

clc
clear all
a=0:pi/120:4*pi;
b=sin(a);
plot(a,b,'r*') OUTPUT
hold on
c=cos(a);
plot(a,c)
d=b+c;
plot(a,d)
xlabel('Angular position') Edited
ylabel('Magnitude')
title('Sin and Cos curve and
their addition')
Program_4:3D graph
of Sine and Cos wave.

clc
clear all
a=0:pi/80:10*pi;
b=sin(a); OUTPUT
c=cos(a);
plot3(a,b,c,'b*')
title('3D Graph')

Program_5:Power curve
from Voltage Equation and
Current Equation

clc
clear all
a=0:pi/100:4*pi;
v=3*sin(a);
plot(a,v,'r')
hold on
i=2*sin(-pi/3+a); OUTPUT
plot(a,i,'b')
p=v.*i;
plot(a,p,'g')
xlabel('Angular
Position')
ylabel('Magnitude')
title('Voltage,Current Edited
And Power Curve')
Discussion:
First of all, it was very interesting to introduce with MATLAB. MATLAB
is just like C Programming language. But MATLAB is easier than C
Programming language included a handsome amount tools. MATLAB
has sufficient tools to edit graphical output i.e. sine and cosine wave.
It is very widely used of EEE students for circuit design and simulation.
Finally, MATLAB is very important for our actual life.

You might also like