How to remove column from matlab table?
Afficher commentaires plus anciens
Dear all,
Given table: TJClean =
Xn_2 Xn_3 Xn_4 Prob1 Prob2 Prob3
____ ____ ____ _______ _______ _______
2 3 4 0.5 0.5 0.25
2 3 4 0.5 0.66667 0.33333
3 2 4 0.25 0.5 0.125
3 2 4 0.25 0.66667 0.16667
3 4 2 0.25 0.5 0.125
3 4 2 0.25 0.66667 0.16667
1 2 3 0.66667 0.5 0.33333
1 2 3 0.66667 0.5 0.33333
1 2 3 0.66667 0.33333 0.22222
2 3 4 0.33333 0.5 0.16667
2 3 4 0.33333 0.5 0.16667
2 3 4 0.33333 0.33333 0.11111
I am trying to remove a column from a matlab table(not a matrix) with the next codes:
%remove one for the last column TJNew= removevars(TJClean,5); TJNew= removevars(TJClean,'Prob2'); TJNew= removevars(TJClean,TJClean.Prob2);
but I am getting this error: Undefined function or variable 'removevars'.
What am I doing wrong? Can somebody give me a suggestion?
Thank you in advance!
Réponse acceptée
Plus de réponses (3)
Cody Brant Watson
le 7 Juin 2019
Modifié(e) : madhan ravi
le 7 Juin 2019
What about ...
TJClean(:,5) = []
Sivabalan Selvarajan
le 3 Août 2019
Modifié(e) : Sivabalan Selvarajan
le 3 Août 2019
You can use
TJClean( : , end-1 ) = [ ] ;
Sivylla Paraskevopoulou
le 28 Déc 2024
0 votes
Catégories
En savoir plus sur Tables dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!