Integration of Matlab Fuzzy .FIS into Java

Hi Actually I have developed one fuzzy rules based system in Matlab Fuzzy editor. Now I want to merge this .FIS file to my Java program where I have developed optimization framework for Grid. My java program will generate input functions for the fuzzy system and will take one output function from fuzzy system. I want to know how I can merge .FIS file in my java code.
some partial solution available without documentation. I would appreciate you provide detail or documentation regarding this integration. Thanks in advance

Answers (1)

Ryan G
Ryan G on 31 Oct 2012
Depending on how you want to deploy this there are a few options. If you are ok with installing the MCR on the PC running Java, you could use MATLAB builder JA to compile a Java class to call from your Java code.
If you do not want to use the MCR, then your options are a bit more limited but you can still do this I believe. You can http://www.mathworks.com/products/fuzzy-logic/description5.html generate C-code> for a Fuzzy controller using Simulink Coder, but then you need to alter the code to create a DLL you can call from Java.

6 Comments

Thank you Ryan for your kind answer, I can go with your second option.But I need some more clarification. Can the Matlab .FIS file be converted into java class? if so I could use directly new converted java class (.fis-->.java) in my java programm where I could give 4 inputs and will take one output value from new converted class . My inputs are not only one time but hundreds times. So it is better to use .FIS file in java rather than my java code in Matlab. Thanks for your valuable time for this.
Ryan G
Ryan G on 1 Nov 2012
Edited: Ryan G on 1 Nov 2012
Here is more info on deploying FIS. Open up the fismain.c and fis.c. These files are the templates in C to read the FIS data. Essentially you will need to alter these to:
1) Call your particular FIS file.
2) Create a DLL that can be called from Java.
The first one should not be too tough from the instructions linked. The second part may be more difficult. Unfortunately that is more of a Java/C interface question than a MATLAB/FIS question and I cannot really say how to do it as I am not familiar with that process.
Once again thanks for your reply. this solution seems very lengthy conversion in two big steps. As your first option concerned that regarding installation of MCR, I can install MCR and will use MATLAB builder JA tool to convert my .fis file into jar. I have seen some tutorial about Matlab builder that mentioning .m file to jar file. Could you please tell me how I can transfer .FIS file to .m file. Then I will try to convert .m file to jar file and in the last I will use .jar file in my java program. your help in this regard would highly be appreciated
I believe you want the evalfis function in the m-file. I am not 100% sure if this function is supported with builder JA, but I don't see why it wouldn't be.
You can find more info on the java builder on the product page.
Thanks a lot Mr. Ryan
With your tips, I have managed the conversion of .FIS to .m file. Now my fuzzy system is working fine in Matlab with .m file and I have also build it in MCR to convert in Java package. There is no error in building java package but I am having some errors when I run this fuzzy system in java Netbeans I am trying to troubleshoot. Hope it would work fine. Once again thank you very much for your valuable help that moved my work forward.
Hi,
I am also trying to use my Matlab .fis in a java web application. I have spent quite a lot of time researching but cannot find a straightforward tutorial on how this is done.
I have the full suite of matlab available and want the most simplest way of using my fis in my eclipse java app.
Can you explain how you converted your .fis into .m and subsequently used the .m in the java app. If you can please explain how you actually call the Matlab function in the java app as well.
Thanks

Sign in to comment.

Categories

Asked:

on 31 Oct 2012

Commented:

on 9 Mar 2019

Community Treasure Hunt

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

Start Hunting!