Main Content

Call .NET Properties That Take an Argument

MATLAB® represents a property that takes an argument as a method. For example, the System.String class has two properties, Chars and Length. The Chars property gets the character at a specified character position in the System.String object. For example:

str = System.String('my new string');
methods(str)

 Display of System.String Methods

Notice that MATLAB displays the Chars property as a method.

The Chars method has the following signature.

Return TypeNameArguments
char scalar RetValChars(System.String this,
int32 scalar index)

To see the first character, type:

Chars(str,0)
ans =
m