"Function" function doesn't work

when I write function dx, this appears. Error: Function definition are not supported in this context. Functions can only be
created as local or nested functions in code files. How can i solve this problem?

1 件のコメント

Torsten
Torsten 2022 年 6 月 12 日
Show is in more detail what you are trying to do and what code you use.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2022 年 6 月 12 日

0 投票

Maybe you have a function after your script in an m-file. If so, add and "end" line after the last line of your function.
function results = dx()
% Body of the function.....
end % Add this line.

カテゴリ

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

質問済み:

2022 年 6 月 12 日

回答済み:

2022 年 6 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by