Azzera filtri
Azzera filtri

How can I apply Fuzzy Inference System in MATLAB App Designer

2 visualizzazioni (ultimi 30 giorni)
Good day to all.
I have designed a system using Fuzzy Logic Toolbox and now I want to implement the Fuzzy Inference System in the standalone application which I am going to develop using MATLAB App Designer.
The basic function of the application is to calculate the risk level of the disease using fuzzy logic. The user will be required to insert the inputs in numerical forms and the ouput will be the risk level. So there will be a button to allow the user to press in order to generate the output.
My question is how to link the .fis file in the button of the App Designer?

Risposta accettata

Subhadeep Koley
Subhadeep Koley il 5 Ago 2019
Hi, you can use uigetfile to achieve the same.
  1. Drag and drop the button onto the designer workspace
  2. Right click the button, hover over 'callbacks', select 'AddButtonPushedFcn callback'
  3. Paste the following code inside the ButtonPushed function
[file,path] = uigetfile('*.fis');
selectedfile = fullfile(path,file);
fuzzyLogicDesigner(selectedfile);
4. Save & Run the App.

Più risposte (3)

Li Mun Ng
Li Mun Ng il 6 Ago 2019
Firstly, thank you so much responding to my question, Subhadeep Koley.
I have tried using the setps suggested by you. However, it will open the .fis file and I still need to insert my data in fis in order to get my result which I intend not to do in fis. But I would like to have a uer interface to execute the calculation part without using fis toolbox. Pardon me, is there an alternative way of computing the fis in my App Designer?
This is how the user interface looks like, but I haven't been able to connect the inputs and output to the fuzzy button in order to genarte the result.
Screenshot (65).png
  4 Commenti
Subhadeep Koley
Subhadeep Koley il 6 Ago 2019
When I am executing the same code for the MATLAB in-built "tipper.fis" fis file it is giving me correct Output everytime.
function FuzzyButtonPushed(app, event)
fis = readfis('tipper');
i1=app.IP1EditField.Value;
i2=app.IP2EditField.Value;
inputs=[i1 i2];
output = evalfis(inputs,fis);
app.OPEditField.Value=output;
end
Therefore it is difficult to say which part went wrong without knowing what inputs your fis expect.
Capture.PNG
Li Mun Ng
Li Mun Ng il 7 Ago 2019
Thank you Subhadeep for your patience and advice and I will try troubleshooting what causes the error. :D

Accedi per commentare.


Walter Roberson
Walter Roberson il 6 Ago 2019

chiwapon nitnara
chiwapon nitnara il 2 Mar 2020
from this code i'm try to use this code to 2 output how to??? Thank you

Categorie

Scopri di più su Fuzzy Inference System Modeling in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by