「 関数 (タイプ'double' の入力引数) が未定義です。」を解決したい。

この質問を見ていただきありがとうございます。
簡単な択一問題のアプリを作ろうと思ったのですが、下記2枠目のようなエラーが繰り返し出てきています。
このエラーを解決するには何をするべきなのでしょうか?
methods (Access = private)
function BottonOn(app)
app.KaitouNomber = app;
if app.SeikaiNomber == app.KaitouNomber
app.TextArea= '正解';
else
app.TextArea='不正解';
end
     end
end
function ButtonPushed(app, event)
app = 1;
BottonOn(app);
end
関数 'BottonOn' (タイプ'double' の入力引数) が未定義です。

 Respuesta aceptada

Atsushi Ueno
Atsushi Ueno el 3 de Jul. de 2022

0 votos

  • appはイベントが発生したオブジェクトの情報なので上書きせずに使用する必要があります
  • 関数は上記のappのフィールド名としてapp.BottonON()と指定します
function ButtonPushed(app, event)
app = 1; % temp = 1; に変更する
BottonOn(app); % app.BottonOn(temp); に変更する
end
  • BottonON()関数の定義部に引数を一つ追加します
function BottonOn(app) % 引数を追加しfunction BottonOn(app,temp)とする

Más respuestas (0)

Categorías

Más información sobre App Designer を使用したアプリ開発 en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Etiquetas

Preguntada:

el 3 de Jul. de 2022

Respondida:

el 3 de Jul. de 2022

Community Treasure Hunt

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

Start Hunting!