I am writing "function y = scmaenc(x, CB, h)" in MATLAB2017a and getting ↑ Error: Function definitions are not permitted in this context. can anyone explain?

1 回表示 (過去 30 日間)
Sajid Sarwar
Sajid Sarwar 2018 年 10 月 18 日
回答済み: Walter Roberson 2018 年 10 月 18 日
I have attached the reference files.

回答 (2 件)

madhan ravi
madhan ravi 2018 年 10 月 18 日
編集済み: madhan ravi 2018 年 10 月 18 日
y = scmaenc(x, CB, h) %call the function properly
you can't run scmaenc.m by clicking the green button because your function requires inputs
  2 件のコメント
Sajid Sarwar
Sajid Sarwar 2018 年 10 月 18 日
I have defined "x, CB and h" but getting same error. If u plz go through the files I have uploaded and then guide me. thank you
madhan ravi
madhan ravi 2018 年 10 月 18 日
show how you are calling the function because I cant see any function calls

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


Walter Roberson
Walter Roberson 2018 年 10 月 18 日
You cannot paste that code in at the command prompt. Leave it stored in the file.
Your simulation also calls upon smadec which you have not provided, so we cannot test to completion. But if you store the files exactly as you attached and run simulation then it will get past calling smaenc and not fail until it needs smadec

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by