Matlab ’s function is power, but not enough. Sometimes, you need some functionality from .net. One example is the Bezier curve class, which is absent in Matlab.
In this example, I created a C# class called BezierCurve:
I would like to use this class in Matlab, and below are the procedures:
- Created a new .Net class library, I call this BezierLib;
- Add the class into the assembly;
- Compile and get the “BezierLib.dll” ;
- In Matlab Command or script file:
BezierLibInfo = NET.addAssembly(‘C:\Temp\BezierLib.dll’);
B=BezierLib.BezierCurve([0,1,2,3,4,5],[0,1,2,3,4,5]); % Constructor
B.EvalVaueAt(3); % Call functions;
That is it.