%SHUFFLE_R_ACROSS_CELLS Randomly permutes, independently for each cell, the
% order of trials collected in response to each stimulus.
%
%   ------
%   SYNTAX
%   ------
%       Rsh = shuffle_R_across_cells(R, nt)
%
%   ---------
%   ARGUMENTS
%   ---------
%   R  - response matrix
%   nt - number of trials available for each per stimulus

%   Copyright (C) 2008 Cesare Magri
%
%   License
%   -------
%   This code is distributed free under the condition that
%   1. it shall not be incorporated in software that is subsequently sold
%   2. the authorship of the software shall be acknowledged in any 
%      pubblication that uses results generated by the software
%   3. this note shall remain in place in each source file

%   Copyright (C) 2008 Cesare Magri
%   Version 1.0.0

% -------
% LICENSE
% -------
% This software is distributed free under the condition that:
%
% 1. it shall not be incorporated in software that is subsequently sold;
%
% 2. the authorship of the software shall be acknowledged and the following
%    article shall be properly cited in any publication that uses results
%    generated by the software:
%
%      Magri C, Whittingstall K, Singh V, Logothetis NK, Panzeri S: A
%      toolbox for the fast information analysis of multiple-site LFP, EEG
%      and spike train recordings. BMC Neuroscience 2009 10(1):81;
%
% 3.  this notice shall remain in place in each source file.