Click here to Skip to main content
15,897,518 members
Articles / Programming Languages / C#

1..2..3 ways of integrating MATLAB with the .NET

Rate me:
Please Sign up or sign in to vote.
4.82/5 (62 votes)
18 Nov 20037 min read 565K   26.1K   127  
A library to access MATLAB from .NET and a comparision of three possible methods to implement it.
<?xml version="1.0"?>
<doc>
    <assembly>
        <name>COMMATLib</name>
    </assembly>
    <members>
        <member name="T:COMMATLib.COMMATAccess">
            <summary>
            MATLAB Interface Class for C# using IDispatch interface
            We can't use the TypeLibrary Import mechanism because it seems broken (from VB6 too)	
            </summary>
        </member>
        <member name="M:COMMATLib.COMMATAccess.#ctor">
            <summary>
            Creates the connection
            </summary>
        </member>
        <member name="M:COMMATLib.COMMATAccess.Evaluate(System.String)">
            <summary>
            Evaluates an expression and returns true on completion		
            </summary>
            <param name="expression">the MATLAB expression</param>
            <returns>true on success</returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.EvaluateAsString(System.String)">
            <summary>
            Evaluates an expression and returns a string
            </summary>
            <param name="expression">the MATLAB expression</param>
            <returns>the MATLAB response</returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.IsVisible">
            <summary>
            Say if the MATLAB window is visible
            </summary>
            <returns></returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.SetVisible(System.Boolean)">
            <summary>
            Fixes the MATLAB windows visibility
            </summary>
            <param name="b"></param>
        </member>
        <member name="M:COMMATLib.COMMATAccess.GetMatrix(System.String,System.Double[0:,0:]@)">
            <summary>
            Gets a matrix variable 
            We use a trick: first get the matrix size using 
               
            </summary>
            <param name="name">name of the matrix</param>
            <param name="data">the matrix, preallocated or not</param>
            <returns></returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.GetMatrixSize(System.String,System.Int32@,System.Int32@)">
            <summary>
            Gets the size of the specified Matrix Variable
            </summary>
            <param name="name"></param>
            <param name="nr"></param>
            <param name="nc"></param>
            <returns></returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.GetMatrixNoResize(System.String,System.Double[0:,0:]@)">
            <summary>
            Gets a Matrix Variable and put it into a double array
            If the array it's not of the correct size the method fails
            </summary>
            <param name="name"></param>
            <param name="data"></param>
            <returns></returns>
        </member>
        <member name="M:COMMATLib.COMMATAccess.SetMatrix(System.String,System.Double[0:,0:])">
            <summary>
            Sets a matrix variable
            </summary>
            <param name="name">Name</param>
            <param name="data">Data</param>
        </member>
        <member name="M:COMMATLib.COMMATAccess.Close">
            <summary>
            Closes the Connection to MATLAB
            </summary>
        </member>
        <member name="F:COMMATLib.COMMATAccess.matObject">
            <summary>
            The COM IDispatch Object
            </summary>
        </member>
        <member name="P:COMMATLib.COMMATAccess.Active">
            <summary>
            Tells if the connection is Active
            </summary>
        </member>
        <member name="P:COMMATLib.COMMATAccess.WorkSpace">
            <summary>
            The Current WorkSpace
            </summary>
        </member>
    </members>
</doc>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior) Scuola Superiore S.Anna
Italy Italy
Assistant Professor in Applied Mechanics working in Virtual Reality, Robotics and having fun with Programming

Comments and Discussions