Issue with sprintf () latex interpreter
116 ビュー (過去 30 日間)
古いコメントを表示
Turbulence Analysis
2022 年 4 月 27 日
コメント済み: Turbulence Analysis
2022 年 4 月 28 日
In the below command, in the place of X=1, is it posiible to call the value that's been defined outside. I tried to use sprintf(), but was not successful.
a = 1;
text(20,2620,{'$[\alpha_{X=1]$'},'FontSize',28,'Color','b','Interpreter','latex');
text(20,2620,sprintf{'$[\alpha_{X='%3dmm',a}]$'},'FontSize',28,'Color','b','Interpreter','latex');
0 件のコメント
採用された回答
Steven Lord
2022 年 4 月 27 日
a = 1;
disp('Here''s how to include a single quote in a char vector')
disp("Here's how to include a single quote in a string array")
fprintf("To include %c in the output of fprintf or sprintf, escape it: \\", '\')
text(0.5,0.25,sprintf('$[\\alpha_{X=''%3dmm''}]$', a),'FontSize',28,'Color','b','Interpreter','latex');
text(0.5,0.75,sprintf("$[\\alpha_{X='%3dmm'}]$",a),'FontSize',28,'Color','b','Interpreter','latex');
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!