![\begin{cases} x =2cos^{3}(t) \\ y=2\sin^{3} (t) \end{cases},t\in [0,2\pi]](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1706336/image.png)
如何在matlab图例中格式化输出参数方程的表达式
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1684451/image.png)
0 Kommentare
Antworten (1)
Esther
am 30 Mai 2024
Bearbeitet: Esther
am 30 Mai 2024
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]](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1706336/image.png)
用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');
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!