How to make a function and input another function
조회 수: 1 (최근 30일)
이전 댓글 표시
i want to make a function and use as input another function . in the second function i will have an equation , at the first one i will have a type . so i can use diferent functions to caldulate the same . for example
function [i] = bbb (r,a,b)
i=@r(a)-@r(b)
end
as r i will use humps or fun or something like that
so when i call it i will write :
bbb (humps,0.5,1)
how can i write it corectly ?
댓글 수: 0
답변 (1개)
Steven Lord
2023년 1월 16일
I think what you want is:
y = bbb(@humps, 0.5, 1)
function [i] = bbb (r,a,b)
i=r(a)-r(b);
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!