11.1 Введение в файлы функций и скриптов
В этом разделе рассматривается семь различных аспектов.
- Ввод функции в командной строке.
- Хранение группы команд в файле — так называемом скриптовом файле.
- Хранение функции в файле — так называемом файле функции.
- Подфункции в файлах функций.
- Несколько функций в одном скриптовом файле.
- Приватные функции.
- Вложенные функции.
И файлы функций, и скриптовые файлы имеют расширение .m для совместимости с MATLAB. Если вы хотите иметь более чем одну независимую функцию в одном файле, то это должен быть скриптовый файл (см. Скриптовые файлы), и для использования этих функций необходимо выполнить скриптовый файл перед использованием функций, находящихся в нём.
© 1996–2022 The Octave Project Developers
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://docs.octave.org/v6.4.0/Introduction-to-Function-and-Script-Files.html