Thread Subject: C# calling method question

Subject: C# calling method question

From: Chang shen

Date: 4 Nov, 2009 22:10:20

Message: 1 of 1

Hi all,
My newbie question for r2009b.

I want to build a .Net assembly so I can use it in C#

I have a Matlab class m-file caled mydll.m

classdef mydll
   properties
       dataout=[];
   end
   methods
       function datao = myf1(var1, var2, var3)
             datao = var1 * var2 * var3;
       end
       function obj = myf2(obj, var1, var2,var3)
             obj.dataout = var1 * var2 ;
       end
   end
   methods (Static)
       function datas = myf3(var1, avr2, var3)
                 datas = var1*var2*var3;
       end
   end
end


I use deploy tool . file -> new -> deployment project create a project
ClassMydll.prj
Then I add a class called cmydll, then add the m-file mydll.m into it.
build the project and the dll

First I install MRC in the machine. I create a C# project. includes Mathwork dlls and ClassMydll.

Now I try to use the methods myf1, myf2, myf3

using ClassMydll;

//I am expecting that I can use them like this:
void function foo()
{
    ClassMydll.cmydll test = new ClassMydll.cmydll();
    MWArray v1 = 1;
    MWArray v2 = 2;
    MWArray v3 = 3;
    MWArray d1 = test.myf1(v1,v2,v3);
    ClassMydll.cmydll t2 = test.myf2(v1,v2,v3);
    MWArray d2 = ClassMydll.cmydll.myf3(v1,v2,v3);
}

But I can not see the methods from C#. The only one is the class constructor mydll
What is wrong?

For early version, I was able to see the methods.

Thanks






    

 

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
c C Shen 4 Nov, 2009 17:14:04
class method C Shen 4 Nov, 2009 17:14:03
rssFeed for this Thread

Contact us at files@mathworks.com