How to include integers and nan values in the same table column?

2 visualizaciones (últimos 30 días)
Hailey Trier
Hailey Trier el 10 de En. de 2019
Comentada: Guillaume el 10 de En. de 2019
Hello,
I have a table with its size, variable types, and variable names pre-allocated:
varTypes = {'double','string','string','double','double'};
varNames = {'ID','keyName','enabled','timeStamp','timeElapsed'};
my_table = table('Size', [10 5], 'VariableTypes',varTypes,'VariableNames',varNames);
I'd like to fill in the table row by row using a loop. In some of my columns of double type data there are integers and NaN values. When I try to fill in the table, I see the error "Subscripted assignment dimension mismatch". Matlab thinks I'm adding both char data (NaN) and integer data to the same column. How can I add NaN values to a double type variable, and add integers to a column where there are already NaN values?
Thanks for your help.
  1 comentario
Guillaume
Guillaume el 10 de En. de 2019
Matlab thinks I'm adding both char data (NaN)
How did you infer that? NaN is not a char type unless you've written 'NaN' with the quotes.
Most likely the problem is with your filling code, which you haven't shown.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by