mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fixed a problem where output matrices don't get assigned anything when they
are empty, leading to MATLAB complaining about output arguments to being assigned.
This commit is contained in:
parent
24b037d569
commit
7f697b420f
@ -1054,6 +1054,12 @@ namespace mex_binding
|
||||
// Don't need to do a copy if it's this kind of matrix since we can just
|
||||
// pull the underlying mxArray out directly and thus avoid a copy.
|
||||
plhs = item._private_release_mxArray();
|
||||
// If there isn't anything there because the matrix is empty then set it to an
|
||||
// empty matrix.
|
||||
if (!plhs)
|
||||
plhs = mxCreateDoubleMatrix(item.nr(),
|
||||
item.nc(),
|
||||
mxREAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1075,6 +1081,13 @@ namespace mex_binding
|
||||
// Don't need to do a copy if it's this kind of matrix since we can just
|
||||
// pull the underlying mxArray out directly and thus avoid a copy.
|
||||
plhs = item._private_release_mxArray();
|
||||
// If there isn't anything there because the matrix is empty then set it to an
|
||||
// empty matrix.
|
||||
if (!plhs)
|
||||
plhs = mxCreateNumericMatrix(item.nr(),
|
||||
item.nc(),
|
||||
mxSINGLE_CLASS,
|
||||
mxREAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user