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.
| 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 |
% 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 laterfis = 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')Our 500+ PhD engineers provide verified MATLAB code, custom Simulink models, and 1-on-1 tutoring with Turnitin plagiarism reports.
Real feedback from students across top engineering universities worldwide.
“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!”
“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!”
Explore deep-dive technical articles written by our engineering team to master complex MATLAB & Simulink topics.
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...
The Memory Wall on Edge Microcontrollers Standard neural networks store weights and compute activations using single-precision floating point (32-bit float...