function [vPeaks,iPeaks] = getPeaks(waves)

   
% [vPeaks,iPeaks] = getPeaks (waves)
%
% This function takes a 3-d matrix as input and generates the peak voltage
% and current for each channel/run.
%
% Input parameter:
% waves: a (m x n x k) matrix containing voltage (in m) and current (in n)
%       for each k channels/run.
% 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Current state of the project and change history.
%
%	Created by:	M. Wetstein
%	Created on:	unknown
%
%	Version: 1.1
%	Modified by: R. Obaid
%	Edited on:	07/08/2011
%	  (a)	Building it as function primitives.
%
% If you type 'help getPeaks' on the Matlab command window, you will be
% able to see the help documentation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

k=length(waves);
[vPeaks(:,(1:k)),iPeaks(:,(1:k))] = max(waves(:,:,(1:k)));

    
end