Indexing by using column names
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a table with column names A, B C. I want to create an array col_index=[1 0 1] by using the column names only.
0 Commenti
Risposta accettata
Chunru
il 13 Set 2021
A = zeros(3,1); B=rand(3,1); C=ones(3,1);
T = table(A, B, C)
VarNames = {'A', 'C'};
col_index = ismember(T.Properties.VariableNames, VarNames)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrices and Arrays 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!