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 件のコメント

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 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeBlock 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