Escaped character '\U' is not valid. See 'doc sprintf' for supported special support.
56 ビュー (過去 30 日間)
古いコメントを表示
Hi MATLAB users,
I know it's asked elsewhere on this webpage (https://ww2.mathworks.cn/matlabcentral/answers/435377-warning-escaped-character-u-is-not-valid). However, I have no idea how to fix it as I'm a newbie.
Below is the warning message that I got from the code. How can I edit it to a valid expression in MATLAB R2022b on Windows 11?
Many thanks in advance!
Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported special
characters.
> In ps_LST_lga (line 254)
In cfg_run_cm (line 29)
In cfg_util>local_runcj (line 1717)
In cfg_util (line 972)
In cfg_ui>MenuFileRun_Callback (line 710)
In gui_mainfcn (line 95)
In cfg_ui (line 53)
Current directory C:Warning: Escaped character '\U' is not valid. See 'doc sprintf' for supported special
characters.
> In ps_LST_lga (line 256)
In cfg_run_cm (line 29)
In cfg_util>local_runcj (line 1717)
In cfg_util (line 972)
In cfg_ui>MenuFileRun_Callback (line 710)
In gui_mainfcn (line 95)
In cfg_ui (line 53)
Warning: Directory already exists.
> In ps_LST_lga (line 290)
In cfg_run_cm (line 29)
In cfg_util>local_runcj (line 1717)
In cfg_util (line 972)
In cfg_ui>MenuFileRun_Callback (line 710)
In gui_mainfcn (line 95)
In cfg_ui (line 53)
Preprocessing of T1.nii 641s
Preprocessing of FLAIR.nii 145s
Coregister FLAIR to T1 91s
Initialize lesions 20-Jan-2023 15:21:31 - Failed 'LST: Lesion segmentation (LGA)'
Out of memory.
In file "C:\MRIapp\toolbox\spm12\toolbox\LST\ps_bwlabeln.m" (???), function "ps_bwlabeln" at line 24.
In file "C:\MRIapp\toolbox\spm12\toolbox\LST\ps_LST_lga.m" (???), function "ps_LST_lga" at line 427.
The following modules did not run:
Failed: LST: Lesion segmentation (LGA)
0 件のコメント
採用された回答
Jan
2023 年 1 月 20 日
編集済み: Jan
2023 年 1 月 20 日
It is a typical bug under Windows, which does not occur, when the software is tested successfully in Linux:
fprintf(['Current folder: ', cd, '\n'])
The Windows file separators \ are interpreted as escape character for fprintf. Solution:
fprintf('Current folder: %s\n', cd)
Now the path appears as argument of fprintf and is not interpreted.
This concerns sprintf, warning and error message also:
error(['Bad folder: ' cd]) % Wrong output under Windows
error('Bad folder: %s', cd) % Working
Check line 254 of ps_LST_lga.m .
This is another problem: "Warning: Directory already exists." If you show us the corresponding part of the code, suggesting a solution is much easier.
"Out of memory." is not a warning, but a crash.
4 件のコメント
Walter Roberson
2023 年 2 月 2 日
Yes, it does, but I do not know why you are pointing that out to me ?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!