Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • PeoplePods 0.9
  • Brackets Sprint 8
  • elFinder 2.0 RC1
  • BBClone 0.6.1
  • Twitter Follow Box...
  • Multilingual Press...
  • SimplePie 1.2.1
  • TinyTips 1.2
  • SWFUpload 2.2.0.1 ...
  • Head Cleaner 1.4.2.9
  • Home > Scripts > Development Tools

    Integrating MATLAB with C#

    Download button


    Downloads: 4,340  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.4/5)
    17 user(s)
    Developer:

    Website:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    David Forstot | More scripts
    www.mathworks.com
    Freeware 

    Windows / Linux / Mac OS / BSD / Solaris
    N/A
    Matlab
    October 3rd, 2007, 12:19 GMT
    C: \ Development Tools

     Read user reviews (1)  Refer to a friend  Subscribe

    Integrating MATLAB with C# description

    Integrating MATLAB with C# - Three methods of integrating MATLAB code into a C# project.

    This demo shows three ways to integrate MATLAB code into a C# project. All three methods use the same example from MATLAB, but each interacts with it in a different fashion.

    The first method shows how to use the MATLAB as an automation server from C# using the engine interface via com automation. This allows you to simultaneously debug your C# application from both the C# side and the MATLAB side, using debuggers on each side.

    The second method uses MATLAB Builder for .NET to create a .NET assembly. This assembly exposes the MATLAB example as a method of a class included in the component. This method can be used directly in C#. It provides intellisense, automatic data marshalling and garbage collection. This .NET assembly can be deployed royalty-free to machines that do not have MATLAB.

    The third method uses MATLAB Compiler to create a C shared library ? unmanaged code. This library exposes the MATLAB example ? but not in a manner that can be used directly in .NET. Instead a wrapper class was created to provide entry into the method included the library, and to marshal the data from the managed framework into the unmanaged library. This C Shared library can also be deployed royalty-free to machines that do not have MATLAB.

    It should be noted that third example is very fragile. It is not the recommended method of C# and MATLAB integration. It has only been provided to emphasize the additional work which becomes necessary to integrate C# with MATLAB when you do not use Builder for .NET.

    This is not a general solution to integrating a MATLAB produced C shared library with .NET but a single purpose solution designed only to work for this example. Upon further inspection it should be clear that the lack of typing when moving from managed to unmanaged code dramatically increases the risk of data handling errors. The lack of intellisense, automatic data marshalling, and garbage collection are additional detractors from this method.

    Requirements:

    · MATLAB Release: R2006b
    · MATLAB Builder for .NET
    · MATLAB Compiler



    TAGS:

    Integrating MATLAB | development tools | MATLAB tools | Integrating | MATLAB | development



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM