Is there a proper way to make a list with the columnnames of a table?

댓글 수: 2

Adam
Adam 2018년 4월 11일
A list in what context? In a UI? On the command line? Saved to file?
Brecht Leenmans
Brecht Leenmans 2018년 4월 11일
list = {'column names of the table'};
[indx,tf] = listdlg('ListString',list);

댓글을 달려면 로그인하십시오.

답변 (1개)

Akira Agata
Akira Agata 2018년 4월 17일

1 개 추천

Column names of your table, say T, can be extracted by T.Properties.VariableNames. The following is a simple example.

% Sample table
load patients
T = table(Gender,Age,Height,Weight,Smoker,Systolic,Diastolic);
% Extract column names and save as 'list'
list = T.Properties.VariableNames;

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

태그

질문:

2018년 4월 11일

답변:

2018년 4월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by