Subscript & superscript equation
조회 수: 14 (최근 30일)
이전 댓글 표시
cannot manage to add the equation in the mention capture shoot image at the matlab !!!
Tried to use the same sequence mention in https://www.mathworks.com/help/symbolic/add-suffixes-to-symbolic-results.html
but didn't work !!!
Tried latex and it gives another answer than it should become.
Kindly need an assistance in that concern !!!
댓글 수: 0
채택된 답변
Cris LaPierre
2021년 7월 2일
편집: Cris LaPierre
2021년 7월 2일
You need to use latex in the equation editor, not symbolic.
This expression x1=x_{b_1}^{a_1} turns into this:
Note that MATLAB only supports a subset of the latex libraries. If you need help building your equation, you can do so interactively in a live script using the equation editor.
댓글 수: 3
Cris LaPierre
2021년 7월 2일
You can also use \frac if you want. This:
\parallel\upsilon^c_n\parallel=\frac{\parallel{P^c_{n+1}-P^c_n}\parallel /}{\Delta} \leq \upsilon_{max}
becomes this:
The Equation Editor creates the expression using slighly different syntax:
\left\|\upsilon_n^c \right\|=\frac{\left\|P_{n+1}^c -P_n^c \right\|}{\Delta }\le \upsilon_{\max}
Once created, you can rt-click on your equation and select 'Copy as latex" if you need to insert the equation elsewhere.
추가 답변 (2개)
Mohamed EL-Baz
2021년 7월 2일
댓글 수: 2
Cris LaPierre
2021년 7월 2일
Try it out and see if it displays correctly. As a hint, you can enclose it in dollar signs to turn it into an equation here in the editor.
$E_{O,k,n}^d(L_{k,n}^d,P_n^c)={\frac{{N_oB\frac{\Delta}{K}}}{g_{k,n}{(P_n^c)}}\times{(2^{\frac{L_{k,n}^d}{B\frac{\Delta}{K}} -{1})$
becomes
Mohamed EL-Baz
2021년 7월 2일
편집: Mohamed EL-Baz
2021년 7월 2일
댓글 수: 4
Cris LaPierre
2021년 7월 2일
편집: Cris LaPierre
2021년 7월 2일
In your ded.jpg image, you were trying to use the Edit Equation tool to create your equations, so that is how I've shown you how to create equations.
In your latest question, it doesn't work because displayFormula is for displaying symbolic equations, not latex equations. Follow this example from the displayFormulat documentation page.
S = "m*diff(y,t,t) == m*g-k*y";
symstr = ["'The equation of motion is'"; S;"'where k is the elastic coefficient.'"];
displayFormula(symstr)
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!