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
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:
Best Answer