MATLAB Programming/Entering data at the command line
Tools
General
Sister projects
In other projects
[MATLAB Programming\|/MATLAB Programming]m]
Chapter 1: MATLAB ._.
Introductions .
Chapter 2: MATLAB Concepts
Chapter 3: Variable Manipulation
Chapter 4: Vector and matrices
Chapter 5: Array
Chapter 6: Graphical Plotting
Chapter 7: M File Programming
Chapter 8: Advanced Topics
Chapter 9: Bonus chapters
The input() function lets your scripts process data entered at the command line. All input is converted into a numerical value or array. The argument for the input() function is the message or prompt you want it to display. Inputting strings require an additional 's' argument. Example:
%test.m%let's ask a user for xx=input('Please enter a value for x:')
Then running the script would produce the output:
Please enter a value for x:3
x=3>>