Error in state of SceneNode

61 ビュー (過去 30 日間)
Mukul
Mukul 2024 年 11 月 17 日 17:15
コメント済み: Walter Roberson 2024 年 11 月 17 日 19:27
I am trying to display values of data points on a plot:
for i = 1:size(Nodes, 1)
txt = sprintf('$T=%.1f%c$C', T(i), char(176));
text(Nodes(i,1), Nodes(i, 2), txt , 'Interpreter','latex');
end
But I keep receiving the following error:
Warning: Error in state of SceneNode.
String scalar or character vector must have valid interpreter syntax:
$T=100.0°$C
I am not sure how to fix this. Can anyone please help?

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 11 月 17 日 17:38
編集済み: Walter Roberson 2024 年 11 月 17 日 19:27
txt = sprintf('$T=%.1f^{\\circ}$C');
This will not be an actual degree symbol, but it is close.
The LaTeX interpreter does not support characters outside of the range 0 to 127. And unfortunately does not support \usepackage to bring in packages that have real degree symbols.
  2 件のコメント
Mukul
Mukul 2024 年 11 月 17 日 18:34
I tried using it but I still get the same error.
Warning: Error in state of SceneNode.
String scalar or character vector must have valid interpreter syntax:
$T=100.0^{
Walter Roberson
Walter Roberson 2024 年 11 月 17 日 19:27
I forgot we were within sprintf(). I have corrected the command.

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by