「 関数 (タイプ'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' の入力引数) が未定義です。

 채택된 답변

Atsushi Ueno
Atsushi Ueno 2022년 7월 3일

0 개 추천

  • 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)とする

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 App Designer を使用したアプリ開発에 대해 자세히 알아보기

제품

릴리스

R2021a

태그

질문:

2022년 7월 3일

답변:

2022년 7월 3일

Community Treasure Hunt

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

Start Hunting!