How to send the output of a fuzzy system to a function

3 visualizaciones (últimos 30 días)
mina ahmadi
mina ahmadi el 22 de Jul. de 2015
Respondida: Sam Chak el 23 de Abr. de 2025
hi
how can i send output of fuzzy to a function ???
thanks

Respuestas (1)

Sam Chak
Sam Chak el 23 de Abr. de 2025
Here is an example of how you can send the output of a fuzzy system to a function:
%% load a fuzzy system
fis = readfis("tipper");
%% input values
Service = 8;
Food = 4;
%% output of the Fuzzy Tipper
Tip = evalfis(fis, [Service, Food])
Tip = 22.2115
%% write a super simple function
function howMuchTipDoIPay(service, food, tip)
formatSpec = 'If the Service is %d and the Food is %d, then the Tip should be %.4f.';
fprintf(formatSpec, service, food, tip)
end
%% send the fuzzy output (as well as inputs) to a function
howMuchTipDoIPay(Service, Food, Tip)
If the Service is 8 and the Food is 4, then the Tip should be 22.2115.

Categorías

Más información sobre Fuzzy Logic Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by