DSP Report Akshat
DSP Report Akshat
TECHNICAL UNIVERSITY
Extension used to save files of simple text in MATLAB is (.m ) and in Simulink it
is (.mdl).
Tool box is a collection of functions built on the MATLAB technical computing
environment.
The resultant default plot we get in MATLAB is blue in colour with solid style
and no marker.
To change Marker, Style and Colour we have following options:-
Style Colour Marker
fig:1
fig:3
y= 3.5.^(-0.5*x)*cos(6*x);plot(x,
y)
Other plot:
x= [-2:0.5:4];
y= 3.5.^(-0.5*x)*cos(6*x);
plot(x, y)
Fig:4
Fig:5
hold on, hold off this function is used to plot multiple graphs.
Let we have a multiple functions between x,y and u,v and t,h
We want to plot a graph y vs x, v vs u, h vs t,
For that we can use a direct function:
plot(x,y,’-b’,u,v,’- -r’,t,h,’:k’)
or we can use a hold on, hold off function
4. Plot a given function, its first derivative and its second derivative:
y=3x^3-26x+10 for -2 < x < 4
Sol. Code: x= [-2:0.01:4];
y= 3*x.^3-26*x+6;
yd= 9*x.^2-26;
ydd= 18*x;
plot(x,y,’-b’,x,yd,’- -r’,x,ydd,’-.k’)
Other code:
x= [-2:0.01:4];
y= 3*x.^3-26*x+6;
yd= 9*x.^2-26;
ydd= 18*x;
plot(x,y,’-b’)
hold on
plot(x,yd,’- -r’)
plot(x,ydd,’-.k’)
hold off
fig:6