O'Reilly logo

MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] by Manoj Kumar Sharma, Ashok Kumar Goel, Raj Kumar Bansal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.3. Interactive Inputs

The following functions/commands can be used by the user for interactive input:

5.3.1. input Function

A user can input data by typing it at the keyboard by using input built-in function. The input function, when invoked, displays a prompt character string in the Command Window waiting for the user to feed the required data. Consider the following statement:

r = input('Enter radius in meters')

When executed, it displays the following character string on the monitor:

Enter radius in meters

It waits for the response of the user to provide the data from the keyboard. Here, it does not force the user to enter only numeric or character string. The user may enter any ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required