Error when Generating a Script from the Import Tool

4 visualizaciones (últimos 30 días)
I am trying to use the import tool to import various file formats. I can do the import successfully, but when I go to generate a script of the import (or live script or function)
I get the following error:
"Import operation failed. The most likely reason is that there are unimportable cells in the selection. ..."
This is true even if I use a file that is in the demo for the Import Tool documentation:
My colleague running the same version (MATLAB R2019a) is able to successfully import and generate the import script.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 7 de Abr. de 2020
For issues like these with example models, check if any files are shadowing build-in MATLAB functions.
In this case, a user-defined "strjoin" function from the MATLAB file exchange was shadowing MATLAB's built-in function of the same name. This caused the errors in the Import tool's "Generate Script" functionality, since it relies on MATLAB's built-in "strjoin" to properly execute.
The solution to avoid shadowing MATLAB's builtin functions is to restore the default MATLAB search path. 1) Before modifying the search path, you can take a backup of your 'pathdef.m' file, which can be located by using the command
>> which -all pathdef
Before proceeding, you should backup this file by copying it to a folder outside of your MATLAB path.
2) After making the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path:
>> restoredefaultpath
>> rehash toolboxcache
3) After this step, try generating the import script again. If the issue is resolved, then you can save the new MATLAB search path by executing the following command:
>> savepath

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by