Main Content

Interpreting Argument Callouts in COM Error Messages

When a MATLAB® client sends a command with an invalid argument to a COM server application, the server sends back an error message in the following format.

??? Error: Type mismatch, argument n.

If you do not use the dot syntax format, be careful interpreting the argument number in this message.

For example, using dot syntax, if you type:

handle.PutFullMatrix('a','base',7,[5 8]);

MATLAB displays:

??? Error: Type mismatch, argument 3.

In this case, the argument, 7, is invalid because PutFullMatrix expects the third argument to be an array data type, not a scalar. In this example, the error message identifies 7 as argument 3.

However, if you use the syntax:

PutFullMatrix(handle,'a','base',7,[5 8]);

MATLAB displays:

??? Error: Type mismatch, argument 3.

In this call to the PutFullMatrix function, 7 is argument four. However, the COM server does not receive the first argument. The handle argument merely identifies the server. It does not get passed to the server. The server reads 'a' as the first argument, and the invalid argument, 7, as the third.

Related Topics