Invalid character in .m file after compiling with MCC
3 views (last 30 days)
Show older comments
I've been pulling my hair for the last 7 hours with an issue I really can't seem to find a solution to or even an explanation of how it is occurring.
I'm currently working on developing a standalone application which among other things uses Matlab slaves to convert files (it starts new Matlab processes which execute certain functions). Here is where the issue occurs. If I run the application from Matlab (without compiling a standalone) it works fine and all the slaves work as expected. However, when I compile a standalone it does not work. The different situations I've tried are:
- Using the master instance of Matlab as well as one additional slave to convert two files (one file for each instance of Matlab). In this case the master instance can successfully convert the file it is given but the slave stops at the following error: Invalid text character. Check for unsupported symbol, invisible character, orpasting of non-ASCII characters.
- Using only the master instance of Matlab to convert two files. In this case the master instance stops at the same error as above.
- Using only the master instance of Matlab to convert ONE file. This works as intended.
- Using the master instance as well as a maximum amount of slaves (number of cores) to convert 8 files. In this instance the master instance succeeds and the rest have the same issue as before.
It seems to be concentrated around the specific function I am trying to run on the slaves. However, this should mean that the master instance shouldn't be able to execute the function either. To tackle the problem so far I've tried:
- Rewriting the entire function (no copying text at all) to get rid of potential hidden characters.
- Rewriting the entire calling parent function.
- Including the affected function as "files installed for the end user" and making sure the application changes to that directory to find the unspoiled .m file.
- Converting the .m files from ANSI to UTF-8 and ISO-8859-1 encoding
- Changing the default encoding for Matlab at startup to UTF-8 and ISO-8859-1
Nothing of the above works at all. There also is no issue at all using the system function in any other state of the application for e.g. compressing files. The entire application works except for this "small" or not small issue.
Any ideas whatsoever?
2 Comments
Walter Roberson
on 7 Aug 2018
Could you talk more about what "converting" files means?
"ncluding the affected function as "files installed for the end user" and making sure the application changes to that directory to find the unspoiled .m file."
That will not help, as compiled executables can never execute .m files.
Is there any relationship between the names of the files being worked with and the name of the function that is failing?
If you save files, where do you save them?
Answers (1)
See Also
Categories
Find more on Application Deployment in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!