Do mex functions support keyword assignment syntax?

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일

0 개 추천

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

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개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2023년 11월 6일

댓글:

2023년 11월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by