Main Content

writeFIS

Save fuzzy inference system to file

Description

writeFIS(fis,fileName) saves the fuzzy inference system fis to the current working folder using file name fileName. You can save files to either a FIS file (*.fis) or a MAT file (*.mat).

example

writeFIS(fis) opens a dialog box for saving a FIS. In this dialog box, specify the name and location of a FIS or MAT file.

writeFIS(fis,fileName,"dialog") opens a dialog box for saving a FIS, setting the name of the FIS or MAT file in the dialog box to fileName. In the dialog box, specify the location for the file.

Examples

collapse all

Create a fuzzy inference system and add an input variable with membership functions.

fis = mamfis(Name="tipper");
fis = addInput(fis,[0 10],Name="service");
fis = addMF(fis,"service","gaussmf",[1.5 0],Name="poor");
fis = addMF(fis,"service","gaussmf",[1.5 5],Name="good");
fis = addMF(fis,"service","gaussmf",[1.5 10],Name="excellent");

Save the fuzzy system in the current working folder.

writeFIS(fis,fis.Name);

Input Arguments

collapse all

Fuzzy inference system, specified as one of these objects:

  • mamfis — Mamdani fuzzy inference system

  • sugfis — Sugeno fuzzy inference system

  • mamfistype2 — Type-2 Mamdani fuzzy inference system

  • sugfistype2 — Type-2 Sugeno fuzzy inference system

  • fistree — FIS tree (since R2024b)

File name, specified as a string or character vector. You can save your fuzzy system using one of the following file types.

  • FIS file (*.fis) — Save a mamfis, sugfis, mamfistype2, or sugfistype2 object.

  • MAT file (*.mat) — Save a mamfis, sugfis, mamfistype2, sugfistype2, or fistree object. (since R2024b)

If you do not specify a file extension, writeFIS adds the .mat extension when fis is a fistree object or the .fis extension for all other FIS objects.

Note

writeFIS changes the name of the saved FIS to match the specified file name.

Tips

  • Do not manually edit the contents of a FIS file. Doing so can produce unexpected results when loading the file using a function, such as readfis and getCodeGenerationData, or an app, such as Fuzzy Logic Designer.

Version History

Introduced in R2018b

expand all