Main Content

Work with .NET Methods Having Multiple Signatures

To create the NetSample assembly, see Build a .NET Application for MATLAB Examples.

The SampleMethodSignature class defines the three constructors shown in the following table.

Return TypeNameArguments
netdoc.SampleMethodSignature objSampleMethodSignature 
netdoc.SampleMethodSignature objSampleMethodSignature(double scalar d)
netdoc.SampleMethodSignature objSampleMethodSignature(System.String s)

 SampleMethodSignature Class

Display Function Signature Example

If you have not already loaded the NetSample assembly, type:

NET.addAssembly('c:\work\NetSample.dll')

Create a SampleMethodSignature object obj:

obj = netdoc.SampleMethodSignature;

To see the method signatures, type:

methods(obj, '-full')

Look for the following signatures in the MATLAB® output:

netdoc.SampleMethodSignature obj SampleMethodSignature
netdoc.SampleMethodSignature obj SampleMethodSignature(double scalar d)
netdoc.SampleMethodSignature obj SampleMethodSignature(System.String s)

For more information about argument types, see Handle Data Returned from .NET Objects.