Reverse concatenation: separate a data array along a specified dimension.

バージョン 1.1.0.0 (1.62 KB) 作成者: DS
INVERSE_CAT splits a given data array into sub-arrays along the specified dimension.
ダウンロード: 449
更新 2012/4/10

ライセンスの表示

[A B]=INVERSE_CAT(DIM,C) splits array C along dimension, DIM, returning sub-arrays A and B.

Examples:
M = [1 2 3; 4 5 6; 7 8 9];
C = cat(2,M,M)
[A B] = inverse_cat(2,C) ... returns A=M and B=M
[A B] = inverse_cat(1,rot90(C)) ... returns A=rot90(M) B=rot90(M)
[A B] = inverse_cat(3,cat(3,M,M)) ... returns A=M and B=M

-----
Note: There are certainly more efficient ways to separate concatenated data. Suggestions for improvement are much appreciated.

*Thanks to Jan Simon for insightful comments.

引用

DS (2024). Reverse concatenation: separate a data array along a specified dimension. (https://www.mathworks.com/matlabcentral/fileexchange/36097-reverse-concatenation-separate-a-data-array-along-a-specified-dimension), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2007b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.1.0.0

Added Jan Simon's method to handle dimensions > 3.

1.0.0.0