is it possible to write a function inside a script?

조회 수: 15 (최근 30일)
Mr M.
Mr M. 2015년 6월 28일
댓글: Walter Roberson 2018년 3월 19일
is it possible to write a function inside a script? for example is it possible to put at the end of the script?

채택된 답변

hatim boui
hatim boui 2017년 1월 25일
you can in MATLAB R2016b or later. functions in scripts
  댓글 수: 1
Jan
Jan 2017년 1월 25일
This has been discussed such frequently in this forum, that it got tedious. And now the answer has changed. Wow.

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

추가 답변 (2개)

Lucijano Berus
Lucijano Berus 2018년 3월 19일
calling subfunctions: https://www.coursera.org/learn/matlab/lecture/9N7ZS/subfunctions
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 3월 19일
subfunctions are not relevant to the question of whether you can define a function inside a script.

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


John D'Errico
John D'Errico 2015년 6월 28일
Short answer: No.
Longer answer: Nnnnnooooo.
Not much else I can say.

카테고리

Help CenterFile Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by