Why do I receive the warning message "mxGetPr should no longer be used with logical data type" when creating MEX function?

1 次查看(过去 30 天)

采纳的回答

MathWorks Support Team
This error occurs only if you pass a logical array as an input to your C-MEX function and use MXGETPR to extract the data from the same.
Logical datatypes were represented as double data until MATLAB 6.1 (Release 12.1). Starting with MATLAB 6.5 (R13), logical data type is a separate class. Since MXGETPR can only be used with double data type, you get the above-mentioned error.
As a solution, you can either convert the data to double using the DOUBLE function before passing it to your C-MEX function or use mxGetLogicals in your C-code.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by