what this error mean

1 回表示 (過去 30 日間)
faten emad
faten emad 2019 年 1 月 27 日
回答済み: madhan ravi 2019 年 1 月 28 日
plz what this error mean ?
Error: Function definitions are not permitted in this context.

回答 (2 件)

Star Strider
Star Strider 2019 年 1 月 27 日
It means that you need to save your function as a seprate function file (a ‘.m’ file with the same name as your function) on your MATLAB search path.
See the documentation on Function Basics (link) for a relevant discussion.

madhan ravi
madhan ravi 2019 年 1 月 28 日
When you are using version prior to 2016b a function definition cannot be included in a script (reason of your error) , therefore you need to save it in a separate file with the same name of a a function. Keep in mind you cannot paste a function in command window (in any versions of matlab).

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by