MATLAB Answers

How to visually check equations

조회 수: 1(최근 30일)
George Peterson
George Peterson 2021년 7월 30일
답변: Cris LaPierre 2021년 7월 30일
Now that MuPad is gone, how does one visually verify you have input your equation properly in matlab? I have had several articles direct me to the new "Live Script" document, but that has a LaTex equation input or the object oriented input similiar to word or overleaf. We shouldn't have to open a Wolfram Alpha website to doublecheck our Matlab equations.
For example, I needed to double check my fittype function
myfittype = fittype(''11.8.*8.85e-12.*area./((((m+2).*11.8.*8.85e-12)./(1.602e-19.*beta).*(Vbi-Va)).^(1./(m+2)))',...
'coefficients',{'Vbi','area','beta','m'},'independent',{'Va'});
I attempted to put that equation into the Life Script document LaTex input, and only got that 1-line back out.
I attempted the pretty function, and recieved an error because it contains a mix of arrays and symols.
Does anyone have an easy solution to this problem?
Thanks,
George

답변(1개)

Cris LaPierre
Cris LaPierre 2021년 7월 30일
You likely need the Symbolic Math Toolbox to do what you want. Note that it it will combine the numeric values in the process.
One way to do this is to use the displayFormula function.
syms Vbi area beta m Va
displayFormula('11.8.*8.85e-12.*area./((((m+2).*11.8.*8.85e-12)./(1.602e-19.*beta).*(Vbi-Va)).^(1./(m+2)))')

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by