Subscript & superscript equation

cannot manage to add the equation in the mention capture shoot image at the matlab !!!
but didn't work !!!
Tried latex and it gives another answer than it should become.
Kindly need an assistance in that concern !!!

 采纳的回答

Cris LaPierre
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 个评论

the brackets was the problem, haven't used it ........... thank you cris
I think it should be written like that :-
\parallel\upsilon^c_n\parallel={\parallel{P^c_{n+1}-P^c_n}\parallel /\Delta} \leqslant\upsilon_{max}
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.
thank you Cris LaPierre .... appreciate your concern

请先登录,再进行评论。

更多回答(2 个)

Mohamed EL-Baz
Mohamed EL-Baz 2021-7-2
the second formula
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})
is that right /?

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
the last number (-1) is subtract from the power not from number 2 !!!!

请先登录,再进行评论。

Mohamed EL-Baz
Mohamed EL-Baz 2021-7-2
编辑:Mohamed EL-Baz 2021-7-2
$E_{O,k,n}^d(L_{k,n}^d,P_n^c)={\frac{{N_oB\frac{\Delta}{K}}}{g_{k,n}{(P_n^c)}} (2^{\frac{L_{k,n}^d}{B\frac{\Delta}{K}}} -1)$
I got it
it was a missing bracket in wrong place ........
Thank you Cris LaPierre

4 个评论

That works, though with some tweaks you can get it to look better.
$E_{O,k,n}^d \left(L_{k,n}^d ,P_n^c \right)=\frac{N_0 B\Delta /K}{g_{k,n} \left(P_n^c \right)}\left(2\frac{L_{k,n}^d }{B\Delta /K}-1\right)$
or
Thank you Cris LaPierre
S = "m\frac{\partial^2}{\partial t^2}=mg - ky";
symstr = ["'The equation of motion is'"; S;"'where k is the elastic coefficient.'"];
displayFormula(symstr)
doesnot display like that
The equation of motion is
where k is the elastic coefficient.
I dont know why!?
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)
The equation of motion is
where k is the elastic coefficient.

请先登录,再进行评论。

产品

版本

R2021a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by