42 C H A P T E R 0: From the Ground Up!
where we usewhosto check its size:
Name Size Bytes Class
xy 121x2 1936 double array
Grand total is 242 elements using 1936 bytesThis indicates that the arrayxyhas 121 rows and 2 columns, the first colum corresponding tox, the
degree values, and the second column corresponding to the sine values,y. Verify this and plot the
values by using
x = xy(:, 1);
y = xy(:, 2);
stem(x, y)Finally, MATLAB provides some data files for experimentation and you only need to load them. The
following “train.mat” is the recording of a train whistle, sampled at the rate ofFssamples/sec, which
accompanies the sampled signaly(n)(see Figure 0.19).
clear all
load train
whos
Name Size Bytes ClassFs 1x1 8 double array
y 12880x1 103040 double arrayGrand total is 12881 elements using 103048 bytes
sound(y, Fs)
plot(y)FIGURE 0.19
Train signal.0 2000 4000 6000 8000 10000 12000− 1−0.500.51n (samples)y[n]