2

I am new to MATLAB. By using the command NET.addAssembly I am loading a .NET assembly, instantiating an object of assembly's class, then I am invoking the methods of the class.

Passing parameters such as double, char to method of assembly class is working fine.

But when I am trying to pass cell array to method of instantiated class, it shows an error parameter mismatch.

I have done the following procedure:

s = NET.addAssembly('name of assembly')
t = s.AssemblyHandle.GetType('Class present in assembly');
obj = System.Activator.CreateInstance(t);
obj.PassCellArray(CellArray);

.NET Method

public void PassCellArray(System.Object[] dd) {}

According to the documentation, we can pass the cell array to a method which has parameter as System.Object[].

So please help me for how to pass cell array to .NET method.

1 Answer 1

2

What exactly is stored inside this cell-array?

According to the documentation, elements of a cell can be any of the following supported types:

While you cannot pass the following MATLAB types to .NET methods:

  • Structure arrays
  • Sparse arrays
  • Complex numbers
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.