Using .Net object in Matlab

03 Jul

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:

  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.

1 Comment

Posted by on July 3, 2010 in Dotnet/C#, Maths


One response to “Using .Net object in Matlab

  1. Hakan_Tek

    July 17, 2013 at 9:28 am

    A important post. Thank you very much.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: