matlab intrinsic function call fails with "Invalid text character" error

25 views (last 30 days)
I have recently installed MATLAB and I get the following error with some of MATLAB intrinsic functions, such as the following:
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
What is the source of this error and how can it be resolved?
A King
A King on 15 May 2020
Edited: A King on 15 May 2020
that solved it! thanks a bunch... there was apparently another copy of this file hidden somewhere in the directories, I do not know how it got there, but I basically removed the whole directory and now the error is gone. perhaps you'd want to write your comment as a separate answer so that I can accept it as the correct answer.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 15 May 2020
Use your system file explorer to find system_dependent.m looking first under your own files and then under the MATLAB installation directory. What do you find?
Basically, you should not find any system_dependent.m as it is an undocumented built-in function.
  1 Comment
Fangliang Bai
Fangliang Bai on 4 Jul 2020
Edited: Fangliang Bai on 4 Jul 2020
This solved my problem. Thanks Walter.
In my case, it turns out that the system_dependent.m was located under my own Matalb App folder that has a Runtime. Delete that folder or remove it from the Matlab setpath should solve this problem.
To locate the system_dependent.m, you cannot click the file in the error message because it will throw the same error again. Instead, you can move your mouse over that file in the error message, the Matlab status bar at the bottom of the window should give you the full path to that file.

Sign in to comment.

More Answers (0)


Find more on Startup and Shutdown 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!