catdim

버전 1.0.0.0 (931 Bytes) 작성자: Andreas Hoechner
Unconcatenate array and catenate along other dimension.
다운로드 수: 763
업데이트 날짜: 2007/8/20

라이선스 없음

OUT=CATDIM(DIMS,A)
with DIMS=[da1,da2;db1,db2;..] an array of size [n,2].
Unconcatenates array A along dimension da1 and concatenates along da2,
then db1 and so on.
At the end squeezes result to remove singelton dimensions.
Useful to reshape a multidimensional array to display it e.g. with imagesc.

Examples:

a=[1,2,3;4,5,6]; a=cat(3,a,a+10)
a(:,:,1) =
1 2 3
4 5 6
a(:,:,2) =
11 12 13
14 15 16

catdim([3,1],a)
ans =
1 2 3
4 5 6
11 12 13
14 15 16
catdim([3,2],a)
ans =
1 2 3 11 12 13
4 5 6 14 15 16

b=[1,2;,3,4]
b =
1 2
3 4
catdim([1,2],b)
ans =
1 2 3 4

c=cat(4,a,a+20)
c(:,:,1,1) =
1 2 3
4 5 6
c(:,:,2,1) =
11 12 13
14 15 16
c(:,:,1,2) =
21 22 23
24 25 26
c(:,:,2,2) =
31 32 33
34 35 36

catdim([3,2;4,1],c)
ans =
1 2 3 11 12 13
4 5 6 14 15 16
21 22 23 31 32 33

인용 양식

Andreas Hoechner (2024). catdim (https://www.mathworks.com/matlabcentral/fileexchange/15990-catdim), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2006b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0