I get this error when I run: "run section" from the editor tab
Error using builtin
Must be a text scalar.
Error in matlab.internal.editor.eval.TempFolder/get.CurrentFolder
Error in matlab.internal.editor.eval.TempFolder/getFolderOnPath
Error in matlab.internal.editor.eval.TmpFilePath.get
Error in matlab.internal.editor.evaluateCode
However, if I run the code in that section using "Evaluate selection" it works fine.
Thank you

 採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022 年 2 月 21 日

0 投票

In general, executing the cell modes of scripts is more sensitive on syntax errors made in other sections sections of the code. Executing the selected section of the code doesn't encount the rest of the code.
From your prompted errors, it looks like that you have some errs in other sections of your script. Scan your code and you will see red highlights on the left sidebar of the editor.

5 件のコメント

Maria Lazzaroni
Maria Lazzaroni 2022 年 2 月 21 日
this is not my problem. I try with the following simple script:
%% 1 section
a = 10+5;
%% 2 section
b = 4+6;
and when I try to run one of the section with "Run section" I still have the same error:
Error using builtin
Must be a text scalar.
Error in matlab.internal.editor.eval.TempFolder/get.CurrentFolder
Error in matlab.internal.editor.eval.TempFolder/getFolderOnPath
Error in matlab.internal.editor.eval.TmpFilePath.get
Error in matlab.internal.editor.evaluateCode
Walter Roberson
Walter Roberson 2022 年 2 月 25 日
Unfortunately the appropriate function has been p'coded and we cannot look at the source.
As an experiment, try
restoredefaultpath; rehash toolboxcache
and see if the problem goes away. If it does, then you have some third-party code on your MATLAB path that is interfering with the function.
Maria Lazzaroni
Maria Lazzaroni 2022 年 2 月 25 日
That works! I will figure out the interfering function. Thanks!
Alexander Smith
Alexander Smith 2022 年 9 月 5 日
is matlab addressing/fixing this issue? syntax errors in other sections should not affect the ability to execute code in given section.
Rik
Rik 2022 年 10 月 21 日
Comment posted as flag by Sascha Senck:
Run sections: Important issue for usability & debugging

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

製品

リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by