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 Chang shen 4 Nov, 2009 17:14:04
class method Chang shen 4 Nov, 2009 17:14:03
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com