Quantcast
Channel: Dotnet/C# – Xinyustudio
Viewing all articles
Browse latest Browse all 204

Using .Net object in Matlab

$
0
0

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:

Use.Net_A

I would like to use this class in Matlab, and below are the procedures:

  1. Created a new .Net class library, I call this BezierLib;
  2. Add the class into the assembly;
  3. Compile and get the “BezierLib.dll” ;
  4. In Matlab Command or script file:
  5. 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.


Filed under: Dotnet/C#, Maths

Viewing all articles
Browse latest Browse all 204

Trending Articles