Change the first half of consecutive 1 in a column into 2
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a matrix with 31 rows and around 500 columns. The matrix has NaN, 0s and 1s. The 1s are always consecutive in each column, but the number is not always the same. There are also some columns without 1s.
I need to find the 1s in each column, count them and calculate the half, then I ned to change the first half into 2s, but the second half of 1s should stay as 1s.
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical 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!