File Exchange

image thumbnail

RESHAPECAT

version 1.0.0.0 (1.73 KB) by Roozbeh Geraili Mikola
RESHAPECAT: Reshapes and Concatenates an array.

0 Downloads

Updated 30 May 2010

View License

% RESHAPECAT(DIM,X,P) takes a M-by-N matrix X and returns breaks
% it down to several M-by-P or P-by-N matrices and concatenates
% them along the dimension DIM.
%
% In general, RESHAPECAT(DIM,X) returns a Concatenateed vector of
% X elements along the dimension DIM.
%
% Notice that DIM has to be either 1 or 2 and also mod(N,P)=0 for DIM=1
% and mod(M,P)=0 for DIM=2.
%
% Examples:
%
% X = [ 1 4 7 10 2 5
% 12 5 8 1 3 6
% 3 6 11 9 2 5
% 2 5 8 5 3 6];
%
% Y1 = reshapecat(1,X,3)
% Y1 =
%
% 1 4 7
% 12 5 8
% 3 6 11
% 2 5 8
% 10 2 5
% 1 3 6
% 9 2 5
% 5 3 6
%
% Y2 = reshapecat(2,X,2)
%
% Y2 =
%
% 1 4 7 10 2 5 3 6 11 9 2 5
% 12 5 8 1 3 6 2 5 8 5 3 6

% See also RESHAPE, PERMUTE, CAT.

Cite As

Roozbeh Geraili Mikola (2021). RESHAPECAT (https://www.mathworks.com/matlabcentral/fileexchange/27800-reshapecat), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!