make a plot of the first second of "raw" in matlab

If you have a vector of raw data called raw and a sampling rate fs, you can create a plot of the first second of the signal using the plot() function as follows:

main.m
t = 0:1/fs:(length(raw)-1)/fs; % Time vector
plot(t, raw);
xlim([0 1]); % Set x-axis limits to the first second
xlabel('Time (s)');
ylabel('Amplitude');
title('First Second of Raw Data');
188 chars
7 lines

This creates a plot of the raw data over the first second of the recording. The xlim() function is used to set the x-axis limits to the first second. The xlabel(), ylabel(), and title() functions are used to label the plot accordingly.

related categories

gistlibby LogSnag