How to check if a table exists?
Mostrar comentarios más antiguos
The table, it exists, will be created by using the command "table". It has columns of both numerican values and strings.
How do I check if the table exists? I tried to use the command exist:
if ~exist(app.T1, 'class')
but it keeps complaining with the below error message:
Error using exist
The first input to exist must be a string scalar or character vector.
Respuesta aceptada
Más respuestas (1)
dpb
el 8 de Dic. de 2019
0 votos
"...will be created by using the command "table"..."
So, there then has to be a variable name on the LHS of the table() statement; that variable name is what you put into the argument list for exist().
If your code creates it, how can it not exist...or is this a test first, create if not yet have done so kind of thing? That could make some sense but same caveat applies unless using the (ugh!) kludge of dynamic naming (and in the hope you don't even know what that is yet, I'm not going to explain it any further! :) ).
1 comentario
Leon
el 8 de Dic. de 2019
Categorías
Más información sobre Data Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!