How to build .Net application based on fuzzy logic controller from fuzzy logic toolbox?
2 views (last 30 days)
Show older comments
I’m trying to make a .NET application in visual studio using a fuzzy logic controller created in fuzzy logic toolbox (MATLAB). I’ve created MATLAB function:
function output = ostateczny( input1, input2, input3, input4 )
…input 5 (structure) initialization…
output=evalfis([input1; input2; input3; input4], input5);
end
I’ve compiled it to a .net assembly library (using Library Compiler as shown in https://www.youtube.com/watch?v=ZeY4_9IPvyA), and added a reference in visual studio to compiled DLL file. Then I’ve written code:
Class1 test = null;
test = new Class1();
object output = test.ostateczny((object)1, (object)200, (object)200, (object)30);
I’ve managed to create object successfully, but calling a method from this object ends with error:
... MWMCR::EvaluateFunction error ... The first input must be a defined DOUBLE matrix
Error in => somename.m at line 816.
... Matlab M-code Stack Trace
...
at
file C:\Users\...\AppData\Local\Temp\...\mcrCache8.5\ostate0\toolbox\fuzzy\fuzzy\evalfis.m, name evalfis, line 83.
at
file C:\Users\...\AppData\Local\Temp\...\mcrCache8.5\ostate0\somename\ somename.m, name somename, line 816.
Is it correct to pass 4 arguments separately in .NET, and then merged them into a matrix in MATLAB source code? Any other tips?
0 Comments
Answers (1)
Hagar Mahmoud
on 3 Dec 2019
Hello Tomasz
Im facing the same issue but with Omnet.
Can you share with me if you done with this, how it was done ?
0 Comments
See Also
Categories
Find more on Fuzzy Logic in Simulink in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!