How can I generate code from the system I've designed in the fuzzy logic designer?

12 visualizzazioni (ultimi 30 giorni)

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 23 Feb 2018
To generate code for your fuzzy logic system, you will need to bring the logic into a Simulink system. This process generally follows these steps:
  1. Create your fuzzy system using the fuzzy system designer. Once complete, <https://www.mathworks.com/help/fuzzy/building-systems-with-fuzzy-logic-toolbox-software.html#FP686 export the system> to the MATLAB workspace by selecting File > Export > To Workspace. 
  2. Bring your exported fuzzy system variable into Simulink using a "<https://www.mathworks.com/help/fuzzy/fuzzylogiccontroller.html Fuzzy Logic Controller>" block. <https://www.mathworks.com/help/fuzzy/generate-code-for-fuzzy-system-using-simulink-coder.html This PID control example> demonstrates this. If you open the model from this example, you will notice a structure named "FIS" in the MATLAB workspace. This is a structure that had previously been exported from the fuzzy logic designer. "FIS" was then brought into Simulink using a fuzzy logic controller block named "Fuzzy Inference System" within the subsystem "Fuzzy PID". In the fuzzy logic controller block, specify the name of your fuzzy logic structure (here, it's "FIS"). From here, you can simulate the model and see how the fuzzy logic controller works, given specific inputs.
  3. When you have completed your model and are ready to generate code for the model, click on the "Build Model" button (or Ctrl-B). When the build process has completed successfully, you will see a new folder in your current folder named "fuzzyPID_grt_rtw". This folder includes all the generated source and header code files your model. Refer to the previously-linked example documentation to read more about the specific files generated.
Note that you will need a Simulink Coder license to generate code for your fuzzy logic system.

Più risposte (0)

Categorie

Scopri di più su Fuzzy Logic in Simulink in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by