Effacer les filtres
Effacer les filtres

Save Matrix values when values change from NaN to a Number in MATLAB

1 vue (au cours des 30 derniers jours)
Buzz
Buzz le 8 Sep 2014
Réponse apportée : Iain le 8 Sep 2014
I have a 3x15000 matrix and I want to save the segments during a change from NaN to a number. So I have large sections that all 3 rows are NaN and when it changes I want to generate a new matrix. Is it best to index the start and end point? How do I set a flag in order to step through all the data?

Réponses (1)

Iain
Iain le 8 Sep 2014
if you ONLY get nans in entire columns, this'll work:
numbers = oldmatrix(~isnan(oldmatrix));
numbers = reshape(numbers, 3, []);

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by