Pulling columns from a table to create new table

조회 수: 51 (최근 30일)
Wafa'a Shanti
Wafa'a Shanti 2018년 4월 2일
댓글: Wafa'a Shanti 2018년 4월 4일
Hello. I have a data table with 8 columns. I am trying to create a new table, with four of these columns, with one being time. I have
tbl=table2array(NumericValueTable(:,[1 2 4 7]))
and generate a date/time error because column 7 is a date and time. I tried to put
tbl=table2array(NumericValueTable(:,[1 2 4 datetime(7)]))
but this did not work, nor did 'datevec'. Is this possible to do?

채택된 답변

Peter Perkins
Peter Perkins 2018년 4월 4일
If you want to make a new table, just use subscripting, no reason to use table2array.
NumericValueTable(:,[1 2 4 7])
will return a table with only those four variables.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by