Unrecognized function or variable

1 回表示 (過去 30 日間)
Steve
Steve 2020 年 12 月 14 日
編集済み: Steve 2020 年 12 月 14 日
a

採用された回答

Daniel Pollard
Daniel Pollard 2020 年 12 月 14 日
Sya is defined in the code body, but not in the function. Read up on the scope of a Matlab variable for more information.
To fix this, you need to somehow define Sya within the functions in which you want to use it. This could be explicitly, by adding the line
Sya = 25;
to the function, or implicitly, by making it an argument of the function. Another option is to make Sya a global variable, but I don't know enough to advise on that and it's easy to use bad practices when using global variables so I'd suggest one of the other options.

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by