congregate
DETAILED DESCRIPTION
Have you ever tried to create a submatrix from an array of cells? Or extract values of a specific member from an array of strctures? If so, this function is for you!! Please see the examples below to get more info upon this function.
EXAMPLES
1. Extracting submatrix from an array of cells
A = {11,12,13;21,22,23};
congregate('A{1:2,2:3}')
ans =
12 13
22 23
2. Converting an array of structures to a 2x3 matrix
S(1).a=[1,2,3]';
S(2).a=[4,5,6]';
congregate('S(:).a')
ans =
1 2 3
4 5 6
3. Converting an array of structures of structures to a 2x2x3 matrix
T(1).a(1).b=[111,112,113]';
T(1).a(2).b=[121,122,123]';
T(2).a(1).b=[211,212,213]';
T(2).a(2).b=[221,222,223]';
congregate('T(:).a(:).b')
ans(:,:,1) =
111 121
211 221
ans(:,:,2) =
112 122
212 222
ans(:,:,3) =
113 123
213 223
인용 양식
Anver Hisham (2023). congregate (https://github.com/anverhisham/congregate), GitHub. 검색됨 .
MATLAB 릴리스 호환 정보
플랫폼 호환성
Windows macOS Linux카테고리
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음
버전 | 게시됨 | 릴리스 정보 | |
---|---|---|---|
1.0.0 |
|