How to split a matrix based on indexing
Afficher commentaires plus anciens
I have a matrix (e.g. 16x11 double) that I want to split up into smaller matrices. I have created a index vector of zeros and ones (e.g. 16x1). Every time there is a one, I would like to split the matrix at this point. So if the 1's appear in row 1,5,12 I would need 3 matrices created from the original (so rows 1 to 4, 5 to 11, 12 to end). It would be useful to increment the matrix name too, like Data1, Data2, Data3. I think this needs to be a for loop? I need to repeat this on numerous sets of data with differing amounts of 1's in my index vector.
1 commentaire
per isakson
le 30 Juin 2016
"Data1, Data2, Data3"   usually triggers a link to   How can I create variables A1, A2,...,A10 in a loop?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multidimensional Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!