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

%%
% In the Mean block, clear the *Running mean* check box and set the 
% *Find the mean value over* parameter to |Each column|. 
% The block processes the input as a two-channel signal with a frame size 
% of three. 

%% 
% Run the model. Display the input and output values.
sim(model)
disp('Data Input')
disp(dsp_examples_u)
disp('Mean Values')
disp(mean_val)


%%
% Under these settings, the block outputs the mean value over each frame of 
% data along both the channels. 

%%
% Close the model.
close_system(model)


%% 
% Copyright 2012 The MathWorks, Inc.