Make a function as the input of a function for iterative computing
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi everyone,
I would like to know how to make a function as the input of a function in matlab. In fact, I want to solve g(x1,x2) from the equation g(x1,x2) = f(x1,x2,g(y1,y2)) by iteration method. The function g is reused as an input of the function f at each iteration step. So I encounter with the problem of making a function as the input of a function.
Can you tell me how to do it? Thank you in advance for your help!!!
Tuan
댓글 수: 0
답변 (1개)
Matt J
2012년 10월 14일
You can do it exactly as you've written it. When you execute f(x1,x2,g(y1,y2)) in MATLAB, the output of g(y1,y2) will be fed into f() as its 3rd argument.
댓글 수: 2
Matt Fig
2012년 10월 14일
Tuan, you must already know that it would help immensely if you showed the actual error message! The more information you give, the quicker we can help...
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!