MATLAB App designer for GUI
조회 수: 14 (최근 30일)
이전 댓글 표시
Hi all,
I am newbie in MATLAB. Currently using MATLAB App designer for create a graphical user interface and fuzzy logic. I need to develope a GUI to easy assess the sustainability performance for my product. The calculation already made using fuzzy logic designer in MatlabApps. Also, I already create the design for my GUI using GUIDE by MatlabApp designer. Then, I would like to insert the coding from fuzzy logic to my GUI, my GUI will works when user insert certain value then when the user click on the button, all the final value will be auto calculate. I know that we need to use callback, since I am a new user I don't know how to enter the coding into the callback. Can I just copy and paste all the coding from my fuzzy logic into my GUI coding? But i really stuck on how to do that
Would someone could give me some hints how I am able to achieve this? Many thanks.
Best regards,
Ainina
댓글 수: 2
Jon
2023년 10월 4일
There are many references in the MATLAB documenation that describe the use and implementation of callbacks in App Designer. Here is one to get started https://www.mathworks.com/help/matlab/creating_guis/write-callbacks-for-gui-in-app-designer.html
Voss
2023년 10월 4일
"Can I just copy and paste all the coding from my fuzzy logic into my GUI coding?"
Maybe. Try it and see what happens.
채택된 답변
Dheeraj
2023년 10월 20일
Hi,
I understand that you are trying to create callback to use in your GUI that implements your fuzzy logic. You can’t just copy paste your fuzzy logic code to create a callback, to create callback functions for the specific GUI components that you want to trigger the fuzzy logic calculations. For example, if you want the calculations to occur when a user clicks a button, you'll create a callback for that button.
Here is a simple example to demonstrate assuming you have 2 inputs for the GUI component, and you have a function named “FuzzyLogic” implemented.
function ImplementFuzzyLogic(app, event)
% Get input values from the GUI components (e.g., edit fields)
input1 = app.InputField1.Value;
input2 = app.InputField2.Value;
% Call your fuzzy logic function with the input values
result = YourFuzzyLogicFunction(input1, input2);
end
In this way you could use callbacks to implement your fuzzy logic. You can also find more about callbacks in the MATLAB’s documentation below. https://www.mathworks.com/help/matlab/creating_guis/write-callbacks-for-gui-in-app-designer.html
Hope this helps.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!