Is it possible to write local function in a function?

조회 수: 1 (최근 30일)
Mr M.
Mr M. 2018년 10월 16일
댓글: Adam 2018년 10월 16일
Or this is possible only for scripts and not for functions?
  댓글 수: 1
Adam
Adam 2018년 10월 16일
A 'local' function inside a function is not possible, but as given in the answer below a 'nested' function is possible. They are not the same thing though. Nested functions have some nice properties and some unpleasant ones, though the latter often don't matter if you don't need to debug and work on the command line during a debug session in the parent function.

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

답변 (1개)

madhan ravi
madhan ravi 2018년 10월 16일
It’s possible.See nested Function

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by