RSS

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:

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.

About these ads
 
Leave a comment

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

 

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: