필터 지우기
필터 지우기

sym: how to subs two variables

조회 수: 11 (최근 30일)
Matze
Matze 2021년 12월 2일
답변: HWIK 2021년 12월 2일
Hello there community-brains,
I try to subs both variables in my 1x1 symbolic function Risym:
- (4755019704836209*x^2*y)/590295810358705651712 + (3714859144393905*x^2)/4611686018427387904 - (8424613852775261*x*y^2)/22835963083295358096932575511191922182123945984 + (3362555543902899*x*y)/576460752303423488 - (1313498259334437*x)/2251799813685248 + (7137508986929047*y^3)/316912650057057350374175801344 - (8632096289783183*y^2)/158456325028528675187087900672 - (1563516049270069*y)/1125899906842624 + 4885987653963271/35184372088832
So there is either x and y. I want to insert my parameters for both of them
  • When i try to substitute them via
subs(Risym,{x,y},{par1,par2})
i get the Error 'Undefined function or variable 'x'.'
  • When i try to substitute one after the other via
Ri_0_T = subs(Risym,par1);
Ri_0_SOC = subs(Ri_0_T,par2);
i get an empy 0x1 sym as a return...
Do you know any other tricks to subs this sym?
Greetings
Newby

답변 (1개)

HWIK
HWIK 2021년 12월 2일
From what you pasted I think you have a symbolic expression not function.
I'm guessing you have some values of par1 and par2 and you want to solve for those by substituting for x and y respectively?
Does this give you what you want?
x = par1;
y = par2;
subs(Risym)

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by