MATLAB

Signal in MATLAB

Posted on
signal in matlab

Sine Wave: >>  x = 0:pi/100:2*pi; >>  y = sin(x); >>  plot(x,y) OR >>  y = sin(linspace(0,2*pi,10)); >>  stem(y) Cosine Wave: >>  x = 0:pi/100:2*pi; >>  y = sin(x); >>  plot(x,y) OR >>  y = cos(linspace(0,2*pi,10)); >>  stem(y) Multiple Signals: >>  x = 0:pi/100:2*pi; >>  y = sin(x); >>  y2 = sin(x-.25); >>  y3 = […]

MATLAB

Plotting Graphs in MATLAB

Posted on
plot in matlab

2D Plot: Plot(Y) Plot(Y) plots the columns of Y versus their index if Y is a real number.   Plot(X,Y) If Y is complex, plot(Y) is equivalent to plot(real(Y),imag(Y)). >> x=0:1:10 x = 0     1     2     3     4     5     6     7     8     9    10 >> y = 0:10:100 y = 0    10    20    30    40    […]