selecting elements from an array
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nikolas Spiliopoulos
le 20 Fév 2017
Commenté : Nikolas Spiliopoulos
le 20 Fév 2017
hi all,
I have an array 3x258, is there any way to create two different arrays where the first one will contain the columns that their last element is negative, and the other one the rest of them? thanks!
0 commentaires
Réponse acceptée
Adam
le 20 Fév 2017
idx = myArray( end, : ) < 0;
negLastElementCols = myArray( :, idx );
theRest = myArray( :, ~idx );
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Types 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!