call a function within another function
조회 수: 2 (최근 30일)
이전 댓글 표시
How to call a m file(this is also one function) within another function
댓글 수: 0
채택된 답변
추가 답변 (4개)
Abhishek M
2014년 4월 1일
Hi,
What I understood is that you are trying to call a m-file through another m-file, if that's what you are trying, then place both the files in the same path and try calling with the same name given for the secondary m-file in the code of the primary m-file.
댓글 수: 0
Dishant Arora
2014년 4월 1일
fucnction functionFileName1()
% Code
functionFileName2; % Another function you want to call
end
댓글 수: 0
Chandrasekhar
2014년 4월 1일
I guess you want to have two function within same m file.
function fun_one()
fun_two();%this is another function
function fun_two()
%function body here
댓글 수: 0
ragesh r menon
2014년 4월 1일
You can use function handles for this. The task is to create a handle of the function you want to call and pass this to the other function. A tutorial is given in the the following link : Applications of Function Handles
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!