필터 지우기
필터 지우기

list of the names of the variables in a column

조회 수: 2 (최근 30일)
alpedhuez
alpedhuez 2020년 6월 19일
댓글: Rasul Khan 2020년 6월 24일
I understand that 'tabulate' will give the list of variable names and their frequencies.
Its output is tb and its first element is the list of variables.
I can display tb(:,1) as a vector.
But when tb(:,1) has many elements, displaying them as vectors will take a lots of spaces and also cannot see the list of all variables in one display. Then, how can one has something in a concise way like
tb(:,1)={Hawaii, Washington, California, New Mexico,...}
?

채택된 답변

Rasul Khan
Rasul Khan 2020년 6월 19일
The output of tb(: , 1) is a cell array with all the variables. You can run this script. It will store the result in a res variable which is a vector
res = [];
cell = tb(:, 1);
for i = 1 : numel(cell)
res = [res cell{i}];
end
  댓글 수: 2
alpedhuez
alpedhuez 2020년 6월 19일
편집: alpedhuez 2020년 6월 19일
run this script. find that res is still a cell array.
Rasul Khan
Rasul Khan 2020년 6월 24일
If tb(: , 1) is a cell array then it should work. Can you share the output of tb(: , 1) ?

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by