%% Compute the Maximum
% Compute the maximum of a 3-by-2 matrix input, |dsp_examples_u|,
% using the <docid:dsp_ref#bvkwx2s-1 Maximum> block.
%
%%
% Open the model.
model = 'ex_maximum_ref';
open_system(model)

%%
% The *Mode* parameter of the Maximum block is set to |Value and Index|. 
% The block processes the input as a two-channel signal with a frame size 
% of three. 

%% 
% Run the model. 
sim(model)

%%
% Display the input and output values.
disp('Data Input')
disp(dsp_examples_u)
disp('Maximum Values')
disp(max_val)
disp('Max Index Array')
disp(max_index)

%%
% In the |Value and Index| mode, the block outputs:
%
% * The maximum value over each frame of data along the channel. 
% * The index of the maximum value in the respective frame.
% 

%%
% Close the model.
close_system(model)

%% 
% Copyright 2012 The MathWorks, Inc.