Invalid character code sequence detected. error using parfor on MATLAB2020b

43 views (last 30 days)
I am on MacOS Big Sur matlab version 2020b. When I call parfor from a script it gives error message ": Invalid character code sequence detected.". When I looked a bit more I got the below message:
The list of cluster profiles failed to load and so they are unusable. To recover, check the reason and restart MATLAB.
Reason: Invalid character code sequence detected. Any idea how to solve this?
btskzn on 17 Nov 2020
When I click on create and manage clusters I have this error message:
"Invalid character code sequence detected.
The list of cluster profiles failed to load and so they are unusable. To recover, check the reason and restart MATLAB.
Reason: Invalid character code sequence detected.
com.mathworks.mvm.exec.MvmRuntimeException: Dot indexing is not supported for variables of this type.
Error in ==> /Applications/>AbstractValidationManager.AbstractValidationManager at 21
Error in ==> /Applications/>ValidationManager.ValidationManager at 48
Error in ==> /Applications/>ValidationManager.getOrCreateInstance at 23 "

Sign in to comment.

Accepted Answer

Priysha LNU
Priysha LNU on 25 Nov 2020
The first reason this issue can occur is if you are trying to run Parallel Computing Toolbox on a non-English local machine.
"Invalid character code sequence detected." usually means non-English characters are in a path or file name. Some potential paths that can cause this issue:
>> tempdir
>> prefdir
>> matlabroot
>> !hostname
Check those paths and make sure they do not contain non-English characters. If they do, change it and then you should be able to use the Cluster Profile Manager.
If you are still experiencing the issue after checking the paths, run the following command within the MATLAB command prompt:
If it returns the following message, this is a known issue with a fix still in the works.
Invalid character code sequence detected
The current workaround to resolve this is to downgrade to MATLAB R2020a.
Hope this helps!
DISCLAIMER: These are my own views and in no way depict those of MathWorks.

More Answers (1)

James Meiss
James Meiss on 8 Dec 2022
I have this problem with Matlab 2021b under MacOS 12.5.7.
I checked the hostname and paths. They have no non-English Characters (that I can discern).
When I run parallel.Settings, I get:
Warning: The following error was caught while executing 'parallel.internal.settings.NamedNodesCollection' class
Error using parallel.internal.settings.CustomSettingsGetSet/get
Undefined function 'num2cell' for input arguments of type 'logical'.
Error in parallel.internal.settings.NamedNode/get.Name (line 112)
name = obj.get(parallel.internal.settings.NamedNode.AliasKeyName);
Error in parallel.settings.Profile/delete (line 104)
Error in parallel.internal.settings.NamedNode/hInvalidate (line 402)
delete(objOrObjs, 'invalidateOnly');
Error in parallel.internal.settings.NamedNodesCollection/delete (line 58)
Error in parallel.Settings/clearProperties (line 592)
obj.ProfilesCollection = [];
Error in parallel.Settings/delete (line 372)
Error in parallel.Settings (line 335)
> In parallel/Settings/clearProperties (line 592)
In parallel/Settings/delete (line 372)
In parallel.Settings (line 335)
Incorrect number or types of inputs or outputs for function 'num2cell'.
Error in parallel.Settings (line 336)


Find more on Parallel Computing Fundamentals 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!

Translated by