Is it possible to write local function in a function?

1 Ansicht (letzte 30 Tage)
Mr M.
Mr M. am 16 Okt. 2018
Kommentiert: Adam am 16 Okt. 2018
Or this is possible only for scripts and not for functions?
  1 Kommentar
Adam
Adam am 16 Okt. 2018
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

madhan ravi
madhan ravi am 16 Okt. 2018
It’s possible.See nested Function

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by