How do I write a command to input "your name" and then display your name on the command window?
Show older comments
I am completely new in Matlab and am having some trouble with the question below:
Q. How do I write a command to input "your name" and then display your name on the command window
Any help is highly appriciated. Thanks in advance!
Answers (1)
Walter Roberson
on 30 Jan 2017
n = input('your name');
disp(n)
2 Comments
Ayush Chaudhary
on 1 Sep 2020
yes it wont work
its for integer value
Walter Roberson
on 5 Mar 2025
My answer is correct if the user inputs something delimited by single quotes ;-)
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!