Converting expression to matlab function in acceptable format

f1 = 2x^2+3y; f2 =y^2+6x;
g1=matlabFunction(f1); g2 = matlabFunction(f2);
Here g1 =@(x,y) 2x^2+3y
But, I want g1 =@(x) 2*x(1)^2+3*x(2)
How to convert in the required format?

답변 (1개)

Alan Weiss
Alan Weiss 2016년 2월 17일

1 개 추천

Alan Weiss
MATLAB mathematical toolbox documentation

댓글 수: 1

Mithun mondal
Mithun mondal 2016년 2월 18일
편집: Mithun mondal 2016년 2월 18일
Dear Alan,
The link is useful. Could you please tell how to use the optimization, using jacobian and hessian for solving system of nonlinear equations from a function file. The method given is for symbolic computation.I would like to use Newton-Raphson for solving the equations.Is it possible to use matlabFunction inside a function file, since I am using symbolic computation which is very lengthy and complex.

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

카테고리

도움말 센터File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기

질문:

2016년 2월 17일

편집:

2016년 2월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by