Passing function with parameters to another function
이전 댓글 표시
Hi,
I am trying to create a function that accepts another function with its own parameters e.g. Func1(@(x)Func2(x,para1,para2,...etc)) Is this possible in Matlab? If yes, how?
답변 (1개)
KSSV
2017년 10월 17일
f1 = @(x,y) x(y) ;
f2 = @(y) sin(y) ;
f1(f2,pi/2)
댓글 수: 3
Mazin Mustafa
2017년 10월 21일
Amjith Shaheer
2020년 7월 1일
Why do u have to put a dot in x.^2 + a;.I am new to Matlab
KSSV
2020년 7월 1일
If x is an array to get element by element square, you have to put . i.e .^
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!