Define Variable Names in a double
조회 수: 31 (최근 30일)
이전 댓글 표시
Hello, so I got a table called zoom, with 4 columns, and I assign a name for each column
zoom = [tempo_novo variavel_novo]; % table
zoom.Properties.VariableNames = {'data','ananas','morango','nutella'};
The problem is now I just want to work with the 2nd, 3rd and 4th column but I want to keep their name. is that possible? And my idea of converting from a table to an array is when I have equations to do I can use "()" instead of "{}" to call the values.
experiencia = table2array(zoom(:,2:end)); % double
experiencia.Properties.VariableNames = {'ananas','morango','nutella'};
댓글 수: 0
채택된 답변
Jan
2018년 2월 20일
table2array converts the table to an array, but arrays do not have names for the columns. Only tables contain such names. Therefore you have to decide if you want to work with the table object or with an array.
댓글 수: 0
추가 답변 (1개)
Peter Perkins
2018년 2월 20일
Tiago, again, I really recommend that you look at the documentation for table subscripting. You will likely find that dot subscripting solves your problem.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!