Using \cdot in sprintf, with latex interpreter

조회 수: 14 (최근 30일)
Jasilva
Jasilva 2022년 1월 27일
댓글: Jan 2022년 12월 11일
set(0, 'defaultTextInterpreter', 'latex');
text(160, 1, (sprintf("$ i(t) = %g \cdot (1 - e^{-t/%g})$", iF, tau)),...
'Fontsize', 15)
This text is for a subtitle on a subplot. The "set interpreter latex" is at the beginning of my code because I need to use it multiple times. I need \cdot to display as a multiplication sign in the subtile. What its displaying right now is this, i(t) = 5 i(t) = 25 .

답변 (1개)

Tibo Geenen
Tibo Geenen 2022년 12월 11일
이동: Jan 2022년 12월 11일
text(0.5, 8, (sprintf("i(t) = %g \\cdot (1 - e^{-t/%g})", 1, 2)),'Fontsize', 15)
This should do it for you.

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by