is it possible to write a function inside a script?

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일

5 개 추천

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일

1 개 추천

calling subfunctions: https://www.coursera.org/learn/matlab/lecture/9N7ZS/subfunctions

댓글 수: 1

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일

0 개 추천

Short answer: No.
Longer answer: Nnnnnooooo.
Not much else I can say.

카테고리

도움말 센터File Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

질문:

2015년 6월 28일

댓글:

2018년 3월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by