Solution
This error is caused when the data structure MATLAB tries to return does not match the structure specified in LabVIEW. As detailed in the
Call MATLAB Function documentation, you must wire a constant or control matching the data type of the top level MATLAB function return type to
return type.
For example, if the MATLAB function returns an array of doubles, you must wire an array of doubles constant or control to
return type. If the MATLAB function returns multiple values, wire a cluster with elements that correspond to the MATLAB function return values. The name and data types and order of the cluster elements must match the MATLAB function return values. For example, if the MATLAB function returns a numeric, a Boolean array, and a string, you must wire
return type to a cluster containing controls or constants of numeric, Boolean array, and string data types in that order. Cluster element names must be unique and not empty. If the MATLAB function does not return any value, leave
return type unwired.
The following is an example of a VI using the Call MATLAB Function to run the
initialize.m program. It has been configured to process three variables (
R, L, hbar) returned from MATLAB.