Making a 3d array with an index that unifies all three layers
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Rich Cavanaugh
il 24 Mar 2018
Commentato: Rich Cavanaugh
il 24 Mar 2018
I am trying to make a 3d array what has one unified index, the first layer of the matrix will just be a number index, the second layer will be a 1 or a 0 (predefined when the matrix is generated) the third layer will be a random character.
so basically I am trying to figure out how to get an index that lets me reference all three pieces of info in one place.
Thanks in advance for any advice or direction.
0 Commenti
Risposta accettata
James Tursa
il 24 Mar 2018
Modificato: James Tursa
il 24 Mar 2018
x = your 3d array
k = your index
result = x(k,k,:); % the three pieces of info at index k
or, depending on how you want to use this downstream
result = squeeze(x(k,k,:)); % the three pieces of info at index k
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!