Error: Function definitions are not permitted in this context.

1 回表示 (過去 30 日間)
Tanmoyee Bhattacharya
Tanmoyee Bhattacharya 2018 年 8 月 22 日
編集済み: Tanmoyee Bhattacharya 2018 年 8 月 22 日
I am trying to do modified menn-kendall in matlab and the code is function[H,p_value]=Mann_Kendall_Modified(V,alpha)
Where V is data series and alpha is 0.05. But error is coming Error:
Function definitions are not permitted in this context.
Can anybody help me to solve it?
  1 件のコメント
madhan ravi
madhan ravi 2018 年 8 月 22 日
You have asked 46 questions and you should be knowing how to format your code by now. Please click the code button to format your question so that others could read it easily.

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

採用された回答

Walter Roberson
Walter Roberson 2018 年 8 月 22 日
It is never permitted to use a "function" statement at the MATLAB command line.
In R2016a and earlier, it is not permitted to use a "function" statement in a script file (a .m file that does not start with 'function' or 'classdef')
In R2016b and later, it become possible to put "function" at the end of a script file. This has some restrictions, including that each "function" must have a matching "end" statement

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLow-Level File I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by