is it possible to write a function inside a script?

14 vues (au cours des 30 derniers jours)
Mr M.
Mr M. le 28 Juin 2015
Commenté : Walter Roberson le 19 Mar 2018
is it possible to write a function inside a script? for example is it possible to put at the end of the script?

Réponse acceptée

hatim boui
hatim boui le 25 Jan 2017
you can in MATLAB R2016b or later. functions in scripts
  1 commentaire
Jan
Jan le 25 Jan 2017
This has been discussed such frequently in this forum, that it got tedious. And now the answer has changed. Wow.

Connectez-vous pour commenter.

Plus de réponses (2)

Lucijano Berus
Lucijano Berus le 19 Mar 2018
calling subfunctions: https://www.coursera.org/learn/matlab/lecture/9N7ZS/subfunctions
  1 commentaire
Walter Roberson
Walter Roberson le 19 Mar 2018
subfunctions are not relevant to the question of whether you can define a function inside a script.

Connectez-vous pour commenter.


John D'Errico
John D'Errico le 28 Juin 2015
Short answer: No.
Longer answer: Nnnnnooooo.
Not much else I can say.

Catégories

En savoir plus sur Block and Blockset Authoring dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by