getrect and ginput are not supported by codegen

10 ビュー (過去 30 日間)
Ricardo Gutierrez
Ricardo Gutierrez 2020 年 12 月 15 日
回答済み: Harsh 2025 年 1 月 30 日 11:40
Hi guys. I am developing a .DLL using the command "codegen", and in an intermediate process I need to select some data from a plot made by the .DLL, then the operations dependent on this selected data continue. For this I am using the "getrect" and "ginput" functions, however, when compiling the .DLL a message appears saying that these functions are not supported by "codegen". In that sense, is there any other function that is supported by "codegen" that I can use?

回答 (1 件)

Harsh
Harsh 2025 年 1 月 30 日 11:40
Hi Ricardo,
The ginput” function allows you to graphically select points from a figure using the mouse and the “getrect” function enables you to interactively select a rectangular region from a figure using the mouse. Since both of these are interactive graphical functions they are not supported for codegen. “.DLL files need to run independently of MATLAB, user interaction via MATLAB figures is not possible. As a workaround you can do the following:
  • Instead of selecting points interactively, pass the coordinates to your function
  • Define selected regions in advance instead of using “getrect
  • Since .DLL files cannot interact with MATLAB figures, do this before calling the “.DLL” files in MATLAB

カテゴリ

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

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by