selecting elements from an array
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nikolas Spiliopoulos
il 20 Feb 2017
Commentato: Nikolas Spiliopoulos
il 20 Feb 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 Commenti
Risposta accettata
Adam
il 20 Feb 2017
idx = myArray( end, : ) < 0;
negLastElementCols = myArray( :, idx );
theRest = myArray( :, ~idx );
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Types in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!