필터 지우기
필터 지우기

How can I express a symbolic variable in function of other symbolic variables,

조회 수: 8 (최근 30일)
hello
is there a predefined function in matlab that can express a symbolic variable depending on other symbolic variables, for example
syms x y z
z=x^2+y^3;
x=f(y,z)=?????????????????
what is a function that allows to write x in terms of y and z
thanks in advance
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2013년 11월 25일
Like a function in a separate file that takes in x and y or like your expression for z which could be rewritten as
z = @(x,y)x^2+y^2;
Then to use:
z(x,y)

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2013년 11월 25일
With newer MATLAB versions, you can use
syms f(y,z)
f(y,z) = x^2+y^3;
  댓글 수: 4
XAXRXTX
XAXRXTX 2013년 11월 30일
편집: XAXRXTX 2013년 11월 30일
thanks walter, it works but you must add a quotes
syms x y z
X = solve('z = x^2+y^3', x);
Walter Roberson
Walter Roberson 2013년 12월 1일
Whether quotes are needed or not depends on the MATLAB version.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2013년 11월 29일
편집: Andrei Bobrov 2013년 11월 29일
syms x y z
xfun = matlabFunction(solve(x^2+y^3 == z,x))
  댓글 수: 3
XAXRXTX
XAXRXTX 2013년 11월 30일
thanks again andrei, but you must add a quotes and eliminate =
syms x y z
xfun = matlabFunction(solve('x^2+y^3 = z',x))

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by