I am using euler's program, and while evaluating the function it always tells like this 'Error: Function definitions are not permitted in this context'.

I am new to MATLAB programming and doesn't know how to use euler's method. please help me to understand that how should be execute while simulating a reaction.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 6 月 22 日
Any line that starts with the word "function" must be stored in a .m file; in particular it must be stored in a function .m file or a classdef .m file, and not a script .m file. A function .m file is a file whose first non-comment is the word "function"; a classdef .m file is a file whose first non-comment is the word "classdef". Any .m file which does not start with "function" or "classdef" as the first non-comment is a "script" .m file, and functions cannot be saved in such files. functions cannot be entered at the command line in MATLAB and they cannot be in script files.

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

質問済み:

2016 年 6 月 22 日

回答済み:

2016 年 6 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by