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

I have recently installed MATLAB and I get the following error with some of MATLAB intrinsic functions, such as the following:
usejava('desktop')
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?

댓글 수: 6

What does this command display?
which -all system_dependent
If it too throws an error try:
builtin('which', '-all', 'system_dependent')
try
restoredefaultpath; rehash toolboxcache
if that improves the problem then savepath
Hi Steve, I tried both, both none throws an error and te problem still persists.
Hi Walter, I tried your suggestion, but that too fails with a similar message:
restoredefaultpath; rehash toolboxcache
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in userpath (line 56)
p = system_dependent('getuserworkfolder');
here is another similar error that I get when I click on an error to open the main.m file where it occurred:
Error in main (line 71)
thisObject.thisMethod ( thisNumber ...
Error using matlab.desktop.editor.openDocument (line 29)
Error: File: system_dependent.m Line: 1 Column: 24
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
Error in opentoline (line 56)
editorObj = matlab.desktop.editor.openDocument(fileName);
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.
A.B.
A.B. 2020년 5월 15일
편집: A.B. 2020년 5월 15일
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.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2020년 5월 15일

1 개 추천

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

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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

질문:

2020년 5월 15일

편집:

2020년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by