Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Type conversion C# and Matlab

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hakansilver - 22 Feb 2008 13:54 GMT
Dear all,

We try to access a third party Matlab dll (which was created using Matlab
COM Builder) from C#. It works fine when using strings and one-dimensional
arrays but fails with two-dimensional arrays. We give our example of the code
below:

static void TestBasicStat()
       {

           MatlabCOM pda = new MatlabCOM();
           Object mError = new int();
           Array TempTagValues = new double[10, 20];
           Object gaTagValues = new Object(); // This is the result from
Matlab. It should be a 2-dim array
           pda.basicstatistics(2, ref gaTagValues, ref            mError,
TempTagValues);  
       }

An exception is thrown from the Matlab code when Matlab tries to access the
two-dimensional array.

Does anyone know if a double array is the correct conversion to a Matlab
matrix?

Also, please let me know if this is not the right newsgroup to post for this
question.

Thank you in advance!

Best regards

Hakan
Kalpesh - 23 Feb 2008 01:07 GMT
Hakan,

I have not worked with matlab & using com from c#.
However, I have a suggestion

What does the intellisense show when you pda.basicstatistics(
Also, you could change
Array TempTagValues = new double[10, 20];
to
double[,] TempTagValues =  new double[10, 20];

HTH
Kalpesh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.