is it possible to write a function inside a script?

3 ビュー (過去 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 Center および File ExchangeBlock and Blockset Authoring についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by