congregate

Version 1.0.0 (8,03 KB) von Anver Hisham
Fetch values from an array of cells (or an array of structures) and create a matrix.
3 Downloads
Aktualisiert 31. Mär 2019

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

Zitieren als

Anver Hisham (2024). congregate (https://github.com/anverhisham/congregate), GitHub. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2019a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Cell Arrays finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!

Versionen, die den GitHub-Standardzweig verwenden, können nicht heruntergeladen werden

Version Veröffentlicht Versionshinweise
1.0.0

Um Probleme in diesem GitHub Add-On anzuzeigen oder zu melden, besuchen Sie das GitHub Repository.
Um Probleme in diesem GitHub Add-On anzuzeigen oder zu melden, besuchen Sie das GitHub Repository.