pick columns with a index vector
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi I have a 30x100 data matrix and a 1x100 index vector with 1s in some columns and 0 elsewhere. How can I pick up columns in the data matrix corresponding to the 1s in the index vector. Thanks in advance.
0 Commenti
Risposte (1)
Azzi Abdelmalek
il 9 Gen 2014
Modificato: Azzi Abdelmalek
il 9 Gen 2014
%Example
A=rand(30,100)
B=randi([0 1],1,100)
%----------------------
out=A(:,logical(B))
3 Commenti
Vedere anche
Categorie
Scopri di più su Matrix Indexing 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!