MATLAB: How to prompt for, and obtain user input from, a MATLAB COM Builder generated object

buildercominputinputdlgMATLAB Builder for COMr13

How do I prompt for, and obtain user input from, a MATLAB COM Builder generated object?
I would like to prompt for user input during execution of a function in my COM object.
Because there is no system prompt, the INPUT function does not work, are there any alternatives?

Best Answer

In order to prompt for user input from a MATLAB COM Builder generated function, you should use the INPUTDLG utility.
This function allows your program to display a graphical dialog box, and obtain user data entered there. Please see the following code for an example:
function myio
x = inputdlg('Enter Your Age :');
msgbox(['You age is : ' num2str(x{1})]);
Detailed information on how to use this function is available from the MATLAB Documentation. Type, "doc inputdlg" at the MATLAB Command Prompt to access this data.
PLEASE NOTE: You will need to link against the C/C++ Graphics libraries in order to do this.
This setting is available from the COMTOOL Project -> Settings menu.