How can I convert a .fis file (fuzzy) into a .m file?

23 次查看(过去 30 天)
I need to convert the file so that I can take the .m file and convert into C code to program a dsp whith a fuzzy controller.
thanks!
  1 个评论
Iman Ansari
Iman Ansari 2013-4-30
编辑:Iman Ansari 2013-4-30
It's a text file, you can open it with matlab editor or notepad. It's for defining your fuzzy system (Inputs, Outputs, Membership Functions, rules, ...), nothing more.

请先登录,再进行评论。

回答(4 个)

Shahar
Shahar 2013-8-29
编辑:Shahar 2013-8-29
You can convert the fis struct to .m code with gencode function from filexchange, at http://www.mathworks.com/matlabcentral/fileexchange/24447-generate-m-file-code-for-any-matlab-variable.
If your code looks something like
myg = readfis('FisFile.fis');
then use
strx = gencode(myg);
fid = fopen('c:\scriptFis.m','w');
fprintf(fid, '%s\n', strx{:});
fclose(fid);
and then you can run scriptFis from command line to load variable myg.
  3 个评论
Walter Roberson
Walter Roberson 2017-7-4
Did you install the noted File Exchange Contribution?

请先登录,再进行评论。


Hagar Mahmoud
Hagar Mahmoud 2019-12-3
Hello
I'm trying the same thing, however the posted example on file exchange for converting .fig file not .fiS files.
I have added the files and run, but I got the follwoing error meesge in scriptFis.m file
warning('myg: No code generated for object of class mamfis.')
Any help ??

Lokesh Srivastava
Lokesh Srivastava 2022-1-10
Can I change the parameters of .fis file in .m file or I can do this only in Fuzzy Logic App Designer?
Because In App Designer every time I change the parameter I have to Save new file and then run the model and if I can do these changes in .m file then just by run the file I can create a updated .fis.
I have tried the above mentioned method to change .fis to .m but on run it gives error :-
'' Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses "
What to do pls help.

wonde Tessema
wonde Tessema 2023-7-3
how to convert text file into FIS file

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by