Effacer les filtres
Effacer les filtres

For loop returns vector with different sizes, how to put them in a single matrix?

1 vue (au cours des 30 derniers jours)
I have a for loop which returns a vector after each iteraion, but the vector length is different each time. How to store the results in a matrix or table or whatever , so that I can use the values for other operations.
for k = 1:length(sect)
SS(k,:) = find(TS{:,2}<sect(k+1) & TS{:,2}>=sect(k) );
k+1;
end
  4 commentaires
Walter Roberson
Walter Roberson le 7 Juil 2019
SS{k} = find(....)
By the way you should consider using histc or histcounts or discretize to determine the bin numbers.
Andrei Bobrov
Andrei Bobrov le 7 Juil 2019
Attach small part of your data here.

Connectez-vous pour commenter.

Réponse acceptée

Pratyush Das
Pratyush Das le 25 Août 2019
SS{k} = find(....)
Thank you Walter Roberson for the answer. It creates a cell array.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by