How do I prompt for, and obtain user input from, a MATLAB COM Builder generated object?

4 views (last 30 days)
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?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!