writetable does not work. Error: Search term must be a text or pattern scalar.

writetable() does not write the table in my matlab2023a. It created an empty file and in the command propt this message is printed: "Search term must be a text or pattern scalar." This message does not have an "Error" label, but is red as an error.
This happen even with very simple tables as the next ones:
t=table([1:10;11:20]);
writetable(t,'t.csv')

 Respuesta aceptada

You have a third-party toolbox that is defining a function with the same name as a Mathworks-supplied function, and that is leading to problems.
As an experiment try
restoredefaultpath; rehash toolboxcache
and then re-run your experiment. If it now works, then you definitely have something on your path that is interfering. (If it still does not work, then the interfering file might be in the current directory.)
I suspect that in your case, the interferring function is named pattern.m but I am not at all certain about that.
Do you have SPM or dfield8 installed?

1 comentario

Thank you! I only have to select the default option in the Set Path. Of course I still need to looking for the problematic file.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Instrument Control Toolbox en Centro de ayuda 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