Write a script called echostring that will prompt the user for a string, and will echo print the string in quotes:
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:3| Question number:3.9
All Answers
total answers (1)
>> echostring
Enter your string: hi there
Your string was: 'hi there'
echostring.m
% Prompt the user and print a string in quotes
str = input('Enter your string: ', 's');
fprintf('Your string was: ''%s''\n',str)
need an explanation for this answer? contact us directly to get an explanation for this answer