Do mex functions support keyword assignment syntax?

4 ビュー (過去 30 日間)
Cesar C
Cesar C 2023 年 11 月 6 日
コメント済み: Walter Roberson 2023 年 11 月 6 日
One may call a native matlab function using any of the following syntaxes:
imwrite(img, fpath, 'Alpha', alpha); % key-value pair using char as key
imwrite(img, fpath, "Alpha", alpha); % key-value pair using string as key
imwrite(img, fpath, Alpha=alpha); % keyword assignment
Do mex files support the keyword assignment syntax? If so, what is the expected type when receiving the data in the matlab::ArgumentList input object (string, char, struct, something else...)?

採用された回答

Stephen23
Stephen23 2023 年 11 月 6 日
移動済み: Walter Roberson 2023 年 11 月 6 日
A few simple experiments show that key=value assignment is converted by the parser into 'key',value. I don't see why it would be any different when calling mex files, as this is something that the parser does all by itself, before anything happens with the function itself.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 11 月 6 日
In a discussion not long ago, Mathworks says that at present the called function cannot tell which syntax the options were specified with; https://blogs.mathworks.com/matlab/?p=1005#reply_2532411

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by