필터 지우기
필터 지우기

substitue part of equation with symbolic value

조회 수: 2 (최근 30일)
gabriele fadanelli
gabriele fadanelli 2020년 8월 4일
답변: Surya Talluri 2020년 8월 7일
Hi everybody,
I have an equation in which i should substitue a piece of information (simbolic variables) with a symbolic letter.
to be more clear, I have the following equation
syms x y
Eq=3*x*y+y^2-y^3;
and would like to define A0 so that A0=0.1*x*y so I tried with function subs
modifiedEq1=subs(Eq,(0.1*x*y),A0);
%or
modifiedEq2=subs(3*x*y+y^2-y^3,(0.1*x*y),A0);
%or
modifiedEq3=subs(3*x*y+y^2-y^3==0,(0.1*x*y),A0);
but none of these work and I have no idea even if it is possible to deal with this problem in Matlab.
Thank you everybody for your help.

답변 (1개)

Surya Talluri
Surya Talluri 2020년 8월 7일
I understand that you want to change 0.1*x*y as a in Eq. Since there is no term 0.1*x*y in the Eq, subs function returns the same Eq without any change. You can substitute x*y with 10*a to get the desired result.
Syms a
Eq = subs(Eq, x*y, 10*a)
Please refer through the following resources and examples for further understanding:

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by