Azzera filtri
Azzera filtri

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

189 visualizzazioni (ultimi 30 giorni)
大輔 菅田
大輔 菅田 il 19 Gen 2021
Commentato: 大輔 菅田 il 24 Gen 2021
コードは以下の通りです。
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

Risposta accettata

Takumi
Takumi il 20 Gen 2021
関数ファイルを実行したのではないでしょうか.関数は,.mファイルに定義した後
E=func1(1:4,1,1)
のように使います.
詳細は関数名、入力および出力の宣言を御覧ください.
  1 Commento
大輔 菅田
大輔 菅田 il 24 Gen 2021
ありがとうございました。

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su プログラミング in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!