list of the names of the variables in a column

3 visualizaciones (últimos 30 días)
alpedhuez
alpedhuez el 19 de Jun. de 2020
Comentada: Rasul Khan el 24 de Jun. de 2020
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,...}
?

Respuesta aceptada

Rasul Khan
Rasul Khan el 19 de Jun. de 2020
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 comentarios
alpedhuez
alpedhuez el 19 de Jun. de 2020
Editada: alpedhuez el 19 de Jun. de 2020
run this script. find that res is still a cell array.
Rasul Khan
Rasul Khan el 24 de Jun. de 2020
If tb(: , 1) is a cell array then it should work. Can you share the output of tb(: , 1) ?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by