Variable name changing in a table

Hello,
I am trying to change the headers for each column of my table to names which I already created in a 1x29 cell array. However using the following code:
GaitAnalysisTable2 = array2table(Data(2:end,:),'VariableNames',GaitAnalysisTableNames);
I am always met with the message 'The VariableNames property must contain one name for each variable in the table'
Unsure as to why this is happening
Thanks

3 comentarios

the cyclist
the cyclist el 16 de Dic. de 2019
Can you upload Data and GaitAnalysisTableNames, in a MAT file? Or at least a small sample of the data that will reproduce the error?
Guillaume
Guillaume el 16 de Dic. de 2019
Unsure as to why this is happening
Easy to answer, the number of columns in Data doesn't match the number of cells in GaitAnalysisTableNames. As per the cyclist comment, without knowing what these are we can't tell you more.
Cameron Kirk
Cameron Kirk el 17 de Dic. de 2019
Thanks for asking both! It appears I've resolved this (but I now have another problem)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Etiquetas

Preguntada:

el 16 de Dic. de 2019

Comentada:

el 17 de Dic. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by