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

MATLAB
% 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)

MATLAB
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')

Need Expert Guidance with MATLAB or Simulink?

Our 500+ PhD engineers provide verified MATLAB code, custom Simulink models, and 1-on-1 tutoring with Turnitin plagiarism reports.

Verified Feedback

What Engineering Students Say

Real feedback from students across top engineering universities worldwide.

Verified Student

“I got full marks on my MATLAB DSP assignment! The filter design code was completely vectorized, the frequency response plots were exact, and the delivery was 8 hours before my deadline. Highly recommended!”

AS

Aditi Sharma

IIT Bombay • Signal Processing Coursework
Verified Student

“Our Simulink EV powertrain model had severe algebraic loop and solver errors. The MATLABSolutions team fixed the solver configuration in 4 hours and provided an annotated scope diagram. Lifesaver for my final year!”

JM

John M.

Monash University, Australia • Simulink Dynamic Model
Technical Knowledge Base

Latest MATLAB Guides & Tutorials

Explore deep-dive technical articles written by our engineering team to master complex MATLAB & Simulink topics.

MATLAB Guide 5 Min Read

Run Convolutional Neural Networks on ARM Cortex-M with MATLAB

Why Run CNNs on Cortex-M Processors? ARM Cortex-M cores power millions of edge sensors, industrial controllers, and medical wearables. Running 1D or 2D Convolutional N...

MATLAB Guide 5 Min Read

INT8 Deep Learning Quantization in MATLAB for Embedded Systems

The Memory Wall on Edge Microcontrollers Standard neural networks store weights and compute activations using single-precision floating point (32-bit float...