Input variable "trimf" does not exist.

here is the code snippet
addMF(input_temperature, 'trimf', [0 0 50], 'cold');
addMF(input_temperature, 'trimf', [0 50 100], 'medium');
addMF(input_temperature, 'trimf', [50 100 100], 'hot');
addMF(input_humidity, 'trimf', [0 0 50], 'low');
addMF(input_humidity, 'trimf', [0 50 100], 'medium');
addMF(input_humidity, 'trimf', [50 100 100], 'high');

 Accepted Answer

Some syntax issues. They are fixed as shown below:
fis = mamfis;
fis = addInput(fis, [0 100], "Name", "input_temperature");
fis = addInput(fis, [0 100], "Name", "input_humidity");
fis = addMF(fis, "input_temperature", 'trimf', [0 0 50], "Name", 'cold');
fis = addMF(fis, "input_temperature", 'trimf', [0 50 100], "Name", 'medium');
fis = addMF(fis, "input_temperature", 'trimf', [50 100 100], "Name", 'hot');
fis = addMF(fis, "input_humidity", 'trimf', [0 0 50], "Name", 'low');
fis = addMF(fis, "input_humidity", 'trimf', [0 50 100], "Name", 'medium');
fis = addMF(fis, "input_humidity", 'trimf', [50 100 100], "Name", 'high');
subplot(211)
plotmf(fis, "input", 1)
subplot(212)
plotmf(fis, "input", 2)

More Answers (0)

Categories

Products

Release

R2023b

Asked:

on 13 Oct 2023

Commented:

on 13 Oct 2023

Community Treasure Hunt

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

Start Hunting!