MATLAB: Need help with cutting 37 seconds off from start of wav file.

audiosoundtrimwav

I have a 43 second wav clip I am trying to trim to make a new sound file. I found a way to cut 3.65 seconds off from the end, however I need help finding a way to cut 37 seconds off from the begining point.
Here is the script so far.
filename = 'C:\Users\ajbaf\Music\mlabpost\wm7001.wav';
[y,fs] = audioread(filename);
endtrim=[1,length(y)-(3.65*fs)];
[y1,fs] = audioread(filename,t,endtrim);
wavFileName = 'C:\Users\ajbaf\Music\mlabpost\wmr.wav';
audiowrite(wavFileName, y1,fs);
Here is a picture of what I working on.
wavWork.jpg

Best Answer

[y,fs] = audioread(filename);
filename = 'C:\Users\ajbaf\Music\mlabpost\wm7001.wav';
y(1:37*fs,:) = []; %% this deletes the matrix elements corresponding to the index range 1:37*fs
y(end-3.65*fs:end,:) = [];
wavFileName = 'C:\Users\ajbaf\Music\mlabpost\wmr.wav';
audiowrite(wavFileName, y,fs);