Why do I receive the warning message "mxGetPr should no longer be used with logical data type" when creating MEX function?
1 次查看(过去 30 天)
显示 更早的评论
mxGetPr should no longer be used with logical data type
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!