How do reshape cell array row to new vectors?
Afficher commentaires plus anciens
I have a variable Big_RIR_AVG which is 1*2611 cell.
Big_RIR_AVG (1) is 59*1 double
Big_RIR_AVG (2) is 60*1 double
Big_RIR_AVG (3) is 59*1 cell( numbers + Nan values as strings)
and so on. So generally the number of rows can be different and the type also is either double or cell.
I also have a vector count= [483 373 396 879 480]
Its sum is 2611 as the length of my columns of the initial variable. So i want to 5 new vectors (483*1, 373*1,396*1,879*1,480*1). The first vector i want to take the Big_RIR_AVG(1,1:483)and take all the elements and create this big vector. And so on for the other 4 vectors.
Any ideas??
3 commentaires
Walter Roberson
le 26 Nov 2015
Is count(K) always greater than or equal to length(Big_RIR_AVG{K}) ? You show indexing Big_RIR_AVG(1,1:483) but your description says that Big_RIR_AVG(1) is only 59 long: is the intention to accumulate elements of Big_RIR_AVG until you have reached the 483 count, then continue on for the next 373 elements, and so on?
David Young
le 26 Nov 2015
Walter: sum(count) is equal to length(Big_RIR_AVG), so I don't think he wants to accumulate elements to reach the count - rather, count(K) must specify the number of cells that combine to make the K'th output vector. The question is only whether the cells or their contents are concatenated - I think it must be the latter because he already has the answer to the former in his question.
Christos Antonakopoulos
le 26 Nov 2015
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical 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!