3

I recently got assigned a task to convert a few algorithms written in matlab to VB.NET (or C# if VB.NET isn't efficient).

The matlab code itself consists of a lot of matrix algebra. I initially looked through here and found there was a Matlab Coder that wrapped the matlab code but when I presented that option I was told it isn't desirable.

I am stuck in a sense that I don't know how to approach this with the proper tools.

Is it normally acceptable to grab libraries (http://www.codeproject.com/Articles/5835/DotNetMatrix-Simple-Matrix-Library-for-NET or http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=907&lngWId=10, these are the only ones I could find) to implement these algorithms or is that generally frowned upon?

Do I need to reinvent the wheel and implement my own algorithms for the algebra (matrix multiplication, choleksy decomposition etc)?

Basically, I am not sure what the accepted way of accomplishing this task is, any input would be appreciated. I apologize if this isn't allowed in here, this is my first time posting but I am a long time lurker.

3
  • as to matrices under vb.net, i'm sure you can find a lot of resources. no need to invent anything, save your time here's another solution if you want to take a look Commented Aug 29, 2012 at 0:44
  • Here's a demo for C#(you can convert C# easily to VB.NET): mathworks.com/matlabcentral/fileexchange/… Commented Aug 29, 2012 at 5:29
  • What you need to do is ask this question to the one who gave you this task. If it is homework, you probably have to code the linear algebra utilities. If it is work, you should use existing technologies. Commented Sep 5, 2012 at 14:46

3 Answers 3

2

You have several possibilities.

If your application can bear the loading time of MCR, you can use Matlab .NET Builder. It will compile a .NET class, which will run MCR silently underneath. All of your clients will be forced to install MCR on their computer.

If your code must be native you can either rewrite the code, or use Matlab Coder, which will convert the code into unreadable, native c++ code.

If you choose to rewrite the code, I would recommend finding an implementation of LAPACK linear algebra routines on .NET, as Matlab is based on them.

Sign up to request clarification or add additional context in comments.

Comments

1

Code like that is published so it can be used and learned from. Just make sure the code's license (if any) is acceptable for your situation.

Comments

1

You can access Matlab functions from VB.net through COM interface

http://www.mathworks.com/help/matlab/matlab_external/view-matlab-functions-from-visual-basic-object-browser.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.