calculate the peak to peak amplitude across 600 data points in 21 trials at two different points in the data in matlab

Assuming you have your data in a matrix data, which has dimensions of 600 (points) x 21 (trials), you can calculate the peak-to-peak amplitude across each trial as follows:

main.m
% first point of interest
first_idx = 100; % replace with your own index
% second point of interest
second_idx = 400; % replace with your own index

% calculate peak-to-peak amplitude across each trial
peak2peak = max(data(second_idx,:)) - min(data(first_idx,:));
264 chars
8 lines

This will give you a 1 x 21 vector of peak-to-peak amplitudes across all trials.

related categories

gistlibby LogSnag