MATLAB Answers


No-copy read object property from mex c++

Rasmus Damgaard Nielsen さんによって質問されました 2019 年 5 月 6 日
最新アクティビティ Rasmus Damgaard Nielsen さんによって コメントされました 2019 年 5 月 7 日
How do i read properties of object arrays through the mex api? Right now i am using getProperty, which is an awfull function. Despite the name, it copies the object, reads the property, and then throw the object away. Then i ask for the next property of the object, the object is copied again and so-on. The c++ mex api was made for high performance supporting code, so of cause there should be some way of doing no-copy reads. Struct support this, and the old API support this, so how to do it in the new API?

  0 件のコメント

サインイン to comment.

1 件の回答

James Tursa
回答者: James Tursa
2019 年 5 月 7 日
編集済み: James Tursa
2019 年 5 月 7 日

There is no official API method to do this with the C API. You have to resort to unofficial hacks. E.g., see this FEX submission for mxGetProperty and mxSetProperty replacements:
But I don't know if these will even work with the new C++ API.

  1 件のコメント

Well... Do you know any way to combine functions from the two API's? MATLAB is quite explicit about the mutual exclusivity...

サインイン to comment.

Translated by