Why do I get the error 'Unable to use a value of type cell as an index.'?

4 visualizaciones (últimos 30 días)
While creating an array2table, it shows an error 'Unable to use a value of type cell as an index.' How can I fix it? (don't pay attention on broken comment font).

Respuestas (1)

Steven Lord
Steven Lord el 8 de Nov. de 2021
Is that table.m file that you have open in the Editor the one included with MATLAB, in which case you shouldn't have modified it? Or is it one that you've created yourself, in which case I recommend renaming it so it doesn't conflict with the table class included in MATLAB?
Regardless I'm guessing the presence of that table.m is the cause of this error.
  3 comentarios
Alexey Eniseysky
Alexey Eniseysky el 9 de Nov. de 2021
Is there another way to show the table with the variable names and units preferably ?
Steven Lord
Steven Lord el 9 de Nov. de 2021
Let's make sure you haven't accidentally shadowed the array2table function with either your own array2table.m or a variable named array2table. What does this command return?
which -all array2table

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by