Clear Filters
Clear Filters

There's an error using input function in my computer , how do I solve it?

1 view (last 30 days)
clear all;
close all;
name=input('Enter your name:','s')
surname=input('Enter your surname:','s')
location=input('Enter your current location:','s')
fprintf('My name is %s%6s and I am currently in %s\n',name,surname,location)

Sign in to comment.

Accepted Answer

Stephen23 on 19 Mar 2018
Edited: Stephen23 on 19 Mar 2018
The error message is telling you that you have a file named input: have a look at the second line of the error message: what does it say? Change the name of the file to something else.
Tip: always use which to check if a name is in use.

More Answers (1)

Image Analyst
Image Analyst on 19 Mar 2018
print is a built-in function, so it is not a good idea to call your m-file print.m. Rename the file and see if that fixes it.


Find more on Startup and Shutdown 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!