undefined function in GUI

7 ビュー (過去 30 日間)
Lim Xiao Hui
Lim Xiao Hui 2021 年 6 月 15 日
コメント済み: Rik 2021 年 6 月 16 日
Hello, can i ask why when i write code for GUI, it show
Undefined function 'multiply' for input arguments of type 'double'.?
Thank you.
  4 件のコメント
Geoff Hayes
Geoff Hayes 2021 年 6 月 15 日
Lim - is multiply a function that you have written because I can't find it in the MATLAB documentation? If it is a custom function (either yours or perhaps from the File Exchange) then the error message is possibly telling you that the function cannot be found along the MATLAB search path. Or you are trying to call a function that doesn't exist anywhere.
Lim Xiao Hui
Lim Xiao Hui 2021 年 6 月 15 日
okok thank you!

サインインしてコメントする。

回答 (1 件)

Kishan Dhakan
Kishan Dhakan 2021 年 6 月 16 日
If you're using MATLAB app designer, it will be easier if you click the 'add a function' button and define your multiply there itself (I see no reason to do it in a separate script). Note: If you add it as a private method, use app.multiply() everywhere.
  3 件のコメント
Kishan Dhakan
Kishan Dhakan 2021 年 6 月 16 日
編集済み: Kishan Dhakan 2021 年 6 月 16 日
Rik, accepted. I meant I see no reason for this 'multiply' specifically. As '*' would do the multiplication in general anywhere, I assumed this function is specific to the app.
Rik
Rik 2021 年 6 月 16 日
Given that you only know the name, it would be a bit odd to assume the functionality is the exact same as *.
Maybe this is what that function does:
function af=multiply(x,y)
af=@(c) x*y + c;
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by