MATLAB: Does MATLAB 7.12 (R2011a) converts a MATLAB empty 0-by-1 matrix into a scalar when passed as an argument to a Java method

MATLAB

I am using the following commands to pass and empty 0-by-1 matrix as an argument to a Java method from the attached 'NullArrayApp' Java class:
>> myJavaArr = NullArrayApp();
>> s = myJavaArr.Method1(zeros(0,1,'int8'))
MATLAB returns the following error:
Error using NullArrayApp/Method1
A Non-scalar value was passed for a scalar argument
This error is thrown by the scalar overloaded Method1 in the NullArrayApp class, which is unable to resolve the null value.

Best Answer

This is a bug. There are currently no workarounds.