Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 118,309 C# Programmers for FREE! Ask your question and get quick answers from experts. There are 1,702 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



matlab interation with C# error

 
Reply to this topicStart new topic

matlab interation with C# error

mare
post 31 Jul, 2008 - 05:41 AM
Post #1


New D.I.C Head

*
Joined: 14 Aug, 2007
Posts: 5


My Contributions


Hi,I'm using MatLab 7.1 and I used their example code from mathworks site to try C# and MatLab integration through COM objects.And this error occurs :

Unable to cast COM object of type 'MLApp.MLAppClass' to interface type 'MLApp.DIMLApp'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{669CEC93-6E22-11CF-A4D6-00A024583C19}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Here is the code:
CODE

using System;
using MLApp;

namespace ConsoleApplication4
{
    class Class1
    {
        [STAThread]
        static void Main(string[] args)
        {
            MLApp.MLAppClass matlab = new MLApp.MLAppClass();

            System.Array pr = new double[4];
            pr.SetValue(11, 0);
            pr.SetValue(12, 1);
            pr.SetValue(13, 2);
            pr.SetValue(14, 3);

            System.Array pi = new double[4];
            pi.SetValue(1, 0);
            pi.SetValue(2, 1);
            pi.SetValue(3, 2);
            pi.SetValue(4, 3);

            matlab.PutFullMatrix("a", "base", pr, pi);// here I get this error

            System.Array prresult = new double[4];
            System.Array piresult = new double[4];

            matlab.GetFullMatrix("a", "base", ref prresult, ref piresult);
        }
    }
}


Can anyone please help me with this?I don't get it.Why did I get this error? Any kind of help(sooner the better smile.gif ) is appreciated.
User is offlineProfile CardPM

Go to the top of the page


zakary
post 31 Jul, 2008 - 05:54 AM
Post #2


D.I.C Regular

Group Icon
Joined: 15 Feb, 2005
Posts: 385



Thanked 4 times

Dream Kudos: 175
My Contributions


my guestion to you is this. "What are the parameters for PutFullMatrix?"
User is offlineProfile CardPM

Go to the top of the page

mare
post 2 Aug, 2008 - 05:56 AM
Post #3


New D.I.C Head

*
Joined: 14 Aug, 2007
Posts: 5


My Contributions


QUOTE(zakary @ 31 Jul, 2008 - 05:54 AM) *

my guestion to you is this. "What are the parameters for PutFullMatrix?"


CODE
void MLAppClass.PutFullMatrix(string Name,string Workspace,Array pr,Array pi)


I really don't get you people,this is supposed to be some kind of forum where I get help,but instead of it,I get only bunch of frustration.
Can you help me or not?
I don't see how your question is supposed to help me.All I did was actually take code from www.mathworks.com,official matlab site,and try to see how it works,but I get that error.And when I post a question trying to get some help from more experienced people,you answer me with a question!Thank you very much for a lot of bunch of nothing!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/10/08 11:46AM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month