Code covered by the BSD License  

Highlights from
TP Tool

from TP Tool by P. Baranyi, Z. Petres, Sz. Nagy
MATLAB Toolbox providing the functions for TP Model Transformation based Control Design

shift_core(D, v)
function S = shift_core(D, v)
%SHIFT_CORE Shift the elements of a tensor
%	S = SHIFT_CORE(D, v)
%
%	D - multidimensional array
%	v - shift matrix
%
%	S - shifted array

% TODO: comment
n = numel(v);
r = numel(D)/n;
S = reshape(D, [r n]);
for i = 1:r
	S(i,:) = S(i,:) + v(:)';
end
S = reshape(S, size(D));

Contact us at files@mathworks.com