How can i convert fis MATLAB fuzzy

MATLAB Illustration

MATLAB's Fuzzy Logic Toolbox stores fuzzy systems in .fis files. You may need to convert between different formats or versions for compatibility, sharing, or deployment.

Common Conversion Scenarios & How to Do Them

 
 
Goal Method Code/Example
Load old .fis file (any version) readfis() – works with all legacy and current .fis files fis = readfis('mycontroller.fis');
Save current FIS to .fis file writefis() (older) or savefis() (recommended) savefis(fis, 'newcontroller');
Convert between FIS types (e.g., Mamdani ↔ Sugeno) Use convertfis() (R2020a+) or manual conversion fis2 = convertToSugeno(fis1); fis2 = convertToType1(fis1); (for Type-2 → Type-1)
Export to FIS v2.0 format (most compatible) Always save with current MATLAB version → automatically uses latest format savefis(fis, 'myfis_v2');
Import from text description (e.g., .fis text format) readfis() works directly on text .fis files fis = readfis('controller.txt');
Convert FIS to code (C, Simulink, etc.) genfis() + code generation tools or evalfis() for simulation Use Fuzzy Logic Designer → Export → To Workspace then Simulink block
Deploy to standalone / embedded Export as C code via MATLAB Coder or Simulink Coder Requires MATLAB Coder + Embedded Coder
Open in newer MATLAB version Just use readfis() — backward compatible since R2017a No extra steps needed
 

Quick One-Liner Conversions

% Load any old .fis and resave as current version fis = readfis('old_controller.fis'); savefis(fis, 'modern_controller'); % creates modern_controller.fis % Convert Mamdani to Sugeno (zero-order or first-order) fis_sugeno = convertToSugeno(fis); % R2020a and later
 
 

Important Notes

  • Since MATLAB R2018b, the default FIS is mamfis / sugfis objects (not structs).
  • readfis() automatically returns the modern object.
  • Old functions like newfis, addvar, addmf are deprecated — use object-oriented syntax instead.

Modern Object Syntax (Recommended)

fis = mamfis('Name','obstacle_avoidance'); fis = addInput(fis,[0 10],'Name','distance'); fis = addMF(fis,'distance','trimf',[0 2 5],'Name','close'); % ... then save savefis(fis,'obstacle_avoidance')

What Our Students Say

★★★★★

“I got full marks on my MATLAB assignment! The solution was perfect and delivered well before the deadline. Highly recommended!”

Aditi Sharma, Mumbai
★★★★☆

“Quick delivery and excellent communication. The team really understood the problem and provided a great solution. Will use again.”

John M., Australia

Latest Blogs

Explore how MATLAB Solutions has helped clients achieve their academic and research goals through practical, tailored assistance.

MCP-Enabled Robotics Control Systems with MATLAB

In today\\\'s rapidly advancing era of automation, robotics control systems are evolving to meet the demand for smarter, faster, and more reliable performance. Among the many innovations driving this transformation is the use of MCP (Model-based Control Paradigms)

LLM-Driven Financial Forecasting Models in MATLAB

The financial sector is witnessing a technological revolution with the rise of Large Language Models (LLMs). Traditionally used for text analysis, LLMs are now being integrated with powerful platforms like MATLAB to develop financial forecasting models