How can I rewrite symbolic expression as a function of another symbolic expression?

조회 수: 1 (최근 30일)
Suppose I want to evaluate an expression of the type with . Let and be functions of x and y, e.g. and . And I am able to show analytically that . Knowing that , I can now rewrite to the expression . With this I can now deduce that if .
However, I want to use a MATLAB script to approximate the exact value of the boundary of the circle/ellipse using a while loop that evaluates at a lower boundary a (where ) and b (where ), so that . However, I do not know how to make MATLAB rewrite my symbolic expression for as a function , so that I can substitute the boundaries a and b. I would be glad about suggestions on how to solve this type of problem.
Thanks for reading!

답변 (1개)

Sai Veeramachaneni
Sai Veeramachaneni 2021년 3월 11일
Hi,
You can leverage syms, diff functions to implement your functionality
Example:
syms x y
V = x^2+y^2
f1 = x
f2 = -x+y*(2-3*x^2-2*y^2)
g = f1*diff(V,x)+f2*diff(V,y)
Hope it helps

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by