find peak to peak amplitude of a 600 by 21 matrix in matlab

You can find the peak-to-peak amplitude of a 600 by 21 matrix A in MATLAB by subtracting the minimum and maximum values across all columns of the matrix using the range function:

main.m
p2p = range(A);
16 chars
2 lines

This will give you a row vector of length 21, where each element represents the peak-to-peak amplitude of the corresponding column.

If you want to find the overall peak-to-peak amplitude (i.e., the maximum difference between any two elements in the entire matrix), you can use the max and min functions:

main.m
p2p = max(A(:)) - min(A(:));
29 chars
2 lines

This will give you a scalar value representing the overall peak-to-peak amplitude.

related categories

gistlibby LogSnag