入力引数が足りない原因が分かりません

コードは以下の通りです。
function e = func1(p, x, y)
e = (p(1)*exp(-((x-p(2))/p(3)) ^2) + p(4)) - y;
end
エラーコードは以下の通りです。
入力引数が不足しています。
エラー: func1 (行 3)
e = (p(1)*exp(-((x-p(2))/p(3)) ^2) + p(4)) - y;
使用環境
R2020b
mac64i

 Accepted Answer

Takumi
Takumi on 20 Jan 2021

0 votes

関数ファイルを実行したのではないでしょうか.関数は,.mファイルに定義した後
E=func1(1:4,1,1)
のように使います.
詳細は関数名、入力および出力の宣言を御覧ください.

1 Comment

大輔 菅田
大輔 菅田 on 24 Jan 2021
ありがとうございました。

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2020b

Community Treasure Hunt

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

Start Hunting!