What is matlab.apps.AppBase
41 次查看(过去 30 天)
显示 更早的评论
In app designer, the first line of code is
classdef app1 < matlab.apps.AppBase
but I cannot find any documentation about this class. Can someone elaborate a bit?
I was trying to create a class from scratch without app designer, and I came across the issue that I cannot assign a callback to a button like this
app.Button.ButtonPushedFcn = @app.buttonCallback
but must do
app.Button.ButtonPushedFcn = createCallbackFcn(app, @buttonCallback, true)
The error that I got is
Error using app1/buttonCallback
Too many input arguments.
I guess the callbacks must be associated using a special way by calling the createCallbackFcn from matlab.apps.AppBase?
2 个评论
采纳的回答
Praveen Reddy
2023-8-29
编辑:Praveen Reddy
2023-8-30
Hi Siaw,
I understand that you are getting an error while trying to create call back to a button by inheriting “matlab.apps.AppBase”. The “matlab.apps.AppBase” class provides various features and functionality specific to App Designer, such as managing the app's components, handling events, and generating the user interface. It serves as the base class for your custom app class, allowing you to inherit and utilize the built-in functionality provided by App Designer. The error you are facing is due to an incorrect usage of the function, “createCallBackFcn" requires you to pass “app”, “callback”, “eventData” as the three input arguments.
Hope this helps!
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!