Write a function in terms of another function
이전 댓글 표시
Hello All, I have 2 functions that are polynomials. For example: F=x1^2+x2^2+2x1x2 and G=(x1+x2)^4 I need to write one of these two functions in terms of the other one. For the example above the answer would be: G as a function of F is: G=F^2 As you know, depending on the complexity of F and G, doing such a manipulation can be very difficult. Therefore, I am wondering if I can use MATLAB to do this. Thank you!
답변 (1개)
the cyclist
2018년 5월 14일
I think this does what you want
F = @(x1,x2)(x1.^2 + x2.^2 + 2*x1.*x2)
G = @(f)f.^2
Call this, for example, as
G(F(1,1))
댓글 수: 2
the cyclist
2018년 5월 14일
Ah. Sorry for my misunderstanding.
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!