- 1). Decide what you want the name of your string to be. In MATLAB, this name can be any collection of letters, numbers, and underscores as long as the name begins with a letter. For example, you might call the variable user_name1.
- 2). Use the input function to prompt the user for the desired input. This function prompts the user with text of your choice and states that the expected variable type is a string. For example, a request for the user's name would have the following form: input('Please enter your name: ', 's').
- 3). Store the user's input into the string variable name you selected. The complete command line will have the following form: user_name1 = input('Please enter your name: ', 's').
- 4). Reference the variable name to retrieve or display the user's input.
EDITOR PICKS & Articles
- Backpacking Information on Pakistan
- Family Holiday - Brilliant Choices Which You Might Go For
- Patagonia: A Leading Destination For Hikers And Anglers
- A Historical Guide of Lahore Attractions!
- Mathura - Important Destination
- Tourism in India
- Goa india
- Aruba Rentals To Choose From To Enjoy Your Stay In The Caribbean
- Some of the best tour packages in India
- Travel to Destination Paradise Greece
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time
Stay With Us