フィルターのクリア

MATLAB App designer for GUI

14 ビュー (過去 30 日間)
Nurul Ainina
Nurul Ainina 2023 年 10 月 4 日
回答済み: Dheeraj 2023 年 10 月 20 日
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
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
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
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 件)

カテゴリ

Help Center および File ExchangeFuzzy Logic Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by