如何在matlab图​例中格式化输出参数方​程的表达式

조회 수: 1 (최근 30일)
巴卡木梨
巴卡木梨 2024년 5월 2일
편집: Esther 2024년 5월 30일
这个函数表达式怎么表示在图例中

답변 (1개)

Esther
Esther 2024년 5월 30일
편집: Esther 2024년 5월 30일
MATLAB支持创建包含 LaTeX 的图例。写出函数对应的LaTex表达式:
\begin{cases} x =2cos^{3}(t) \\ y=2\sin^{3} (t) \end{cases},t\in [0,2\pi]
\begin{cases} x =2cos^{3}(t) \\ y=2\sin^{3} (t) \end{cases},t\in [0,2\pi]
legend 函数并将 Interpreter 属性设置为 'latex' ,将LaTex表达式用美元符号 ($) 将标记括起来即可在图例中表示。例如:
t = linspace(0, 2*pi, 1000);
x = 2*cos(t).^3;
y = 2*sin(t).^3;
plot(x, y);
legend('$\begin{cases} x =2cos^{3}(t) \\ y=2\sin^{3} (t) \end{cases},t\in [0,2\pi]$','Interpreter','latex');

카테고리

Help CenterFile Exchange에서 环境和设置에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!